/* --- style.css --- */
:root {
    --primary: #2563EB; 
    --primary-hover: #1D4ED8;
    --accent: #F97316; 
    --bg-body: #F8FAFC;       
    --sidebar-bg: #0F172A;    
    --surface: #FFFFFF;       
    --text-main: #1E293B;     
    --text-sub: #64748B;      
    --border-color: #E2E8F0;  
    --radius-lg: 20px;        
    --radius-md: 12px;        
    --sidebar-width: 260px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { 
    font-family: 'Plus Jakarta Sans', "PingFang SC", "Microsoft YaHei", sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    height: 100vh; 
    overflow: hidden; 
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

a { text-decoration: none; color: inherit; }

/* 通用组件 */
.btn { display: flex; justify-content: center; align-items: center; width: 100%; padding: 14px; border-radius: var(--radius-md); font-weight: 600; font-size: 14px; cursor: pointer; transition: 0.3s; border: 1px solid transparent; letter-spacing: 0.3px; }
.btn-primary { background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%); color: white; box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 10px rgba(37, 99, 235, 0.3); }
.btn-outline { border: 1px solid var(--border-color); color: var(--text-main); background: white; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #EFF6FF; }
.btn-option { background: white; border: 1px solid var(--border-color); color: var(--text-sub); border-radius: var(--radius-md); font-weight: 500; transition: 0.2s; }
.btn-option:hover { border-color: #CBD5E1; color: var(--text-main); }
.btn-option.selected { background: #EFF6FF; color: var(--primary); border-color: var(--primary); font-weight: 700; box-shadow: 0 0 0 1px var(--primary); }
.btn-option.selected::after { content: none; }

.card-panel { background: var(--surface); border: 1px solid #F1F5F9; border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-md); margin-bottom: 24px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; color: #334155; font-size: 13px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;}
.form-input { width: 100%; padding: 14px 16px; background: #FFFFFF; border: 1px solid var(--border-color); border-radius: var(--radius-md); color: var(--text-main); font-size: 15px; transition: 0.2s; }
.form-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); }
.form-textarea { width: 100%; padding: 14px 16px; background: #FFFFFF; border: 1px solid var(--border-color); border-radius: var(--radius-md); color: var(--text-main); font-size: 15px; font-family: inherit; resize: vertical; min-height: 80px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* 布局框架 */
#app-screen { display: flex; height: 100vh; flex-direction: column; }
.top-bar { height: 72px; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; z-index: 100; }
.top-right-group { display: flex; align-items: center; gap: 20px; }
.sidebar { position: fixed; top: 0; left: 0; height: 100%; width: var(--sidebar-width); background: var(--sidebar-bg); color: #94A3B8; transform: translateX(-100%); transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1001; padding: 32px 20px; box-shadow: 4px 0 24px rgba(0,0,0,0.05); }
.sidebar.active { transform: translateX(0); }
.nav-item { padding: 16px 20px; display: flex; align-items: center; gap: 16px; color: #94A3B8; cursor: pointer; border-radius: 12px; font-size: 14px; font-weight: 500; margin-bottom: 4px; transition: all 0.2s; }
.nav-item:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-item.active { background: var(--primary); color: white; font-weight: 600; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px); z-index: 1000; display: none; }
.overlay.active { display: block; }
.main-content { flex: 1; overflow-y: auto; padding: 32px; background: var(--bg-body); }

/* Logo */
.logo-img { max-height: 48px; width: auto; display: block; }

/* 弹窗 & Toast */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); align-items: center; justify-content: center;}
.modal-content { background-color: white; padding: 32px; border-radius: 24px; width: 90%; max-width: 550px; box-shadow: var(--shadow-float); position: relative; max-height: 85vh; overflow-y: auto;}
.close-modal { position: absolute; top: 20px; right: 24px; color: #94A3B8; font-size: 24px; cursor: pointer; transition: 0.2s;}
.close-modal:hover { color: var(--text-main); }
#toast { visibility: hidden; min-width: 250px; background-color: #333; color: #fff; text-align: center; border-radius: 4px; padding: 12px; position: fixed; z-index: 3000; left: 50%; bottom: 30px; transform: translateX(-50%); font-size: 14px; }
#toast.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
@keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 30px; opacity: 1;} }
@keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }

/* 表格 */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.data-table th { text-align: left; padding: 16px; color: #64748B; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-color); }
.data-table td { padding: 16px; border-bottom: 1px solid #F1F5F9; color: var(--text-main); font-weight: 500; transition: 0.2s; }
.data-table tr:hover td { background: #F8FAFC; }
.data-table tr:last-child td { border-bottom: none; }

/* 状态 Badge */
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.status-default { background: #E2E8F0; color: #475569; }
.status-pending { background: #FEF3C7; color: #D97706; }
.status-active { background: #DCFCE7; color: #166534; }
.status-rejected { background: #FEE2E2; color: #991B1B; }

/* 响应式 */
@media (min-width: 768px) {
    .sidebar { transform: translateX(0); } 
    .menu-btn { display: none; }
    .main-content { margin-left: var(--sidebar-width); padding: 40px; max-width: 1600px; width: calc(100% - var(--sidebar-width)); margin-right: auto; }
    .top-bar { padding-left: calc(var(--sidebar-width) + 32px); }
    .overlay { display: none !important; }
    .grid-desktop-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; width: 100%; }
    .grid-desktop-2 .btn { max-width: none; width: 100%; }
}