* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #f0f2f5; color: #333; }
a { color: #1a73e8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Login */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #eef2f7;
}
.login-card {
    background: #fff;
    padding: 40px 36px 28px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 400px;
    text-align: center;
}
.login-logo-area { margin-bottom: 16px; }
.login-logo {
    width: 48px;
    height: auto;
    display: block;
    margin: 0 auto;
}
.login-brand {
    font-family: 'ZCOOL XiaoWei', sans-serif;
    font-size: 36px;
    color: #1a1a2e;
    letter-spacing: 2px;
    margin-bottom: 6px;
}
.login-tagline {
    font-family: 'Noto Serif SC', serif;
    font-weight: 300;
    font-size: 14px;
    color: #888;
    letter-spacing: 4px;
    margin-bottom: 28px;
}
.login-field {
    margin-bottom: 14px;
    text-align: left;
}
.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}
.login-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #f8f9fb;
}
.login-field input:focus {
    border-color: #0f62fe;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15,98,254,0.1);
}
.login-btn {
    width: 100%;
    padding: 12px;
    background: #0f62fe;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}
.login-btn:hover { background: #0053d6; }
.login-footer {
    margin-top: 24px;
    font-size: 11px;
    color: #aaa;
}
.login-card form button {
    width: 60%;
    display: block;
    margin: 16px auto 0;
}

/* Flash */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.flash.success { background: #e6f7e6; color: #1a7d1a; border: 1px solid #b7e0b7; }
.flash.error { background: #fde8e8; color: #c41e1e; border: 1px solid #f5c6c6; }

/* Form */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #555; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 14px; outline: none; transition: border 0.2s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,0.15); }
.field textarea { min-height: 80px; resize: vertical; }
.field .help { font-size: 12px; color: #999; margin-top: 4px; }
.field.checkbox { display: flex; align-items: center; gap: 8px; }
.field.checkbox label { margin: 0; }
.field.checkbox input[type="checkbox"] { width: auto; }

/* Buttons */
.btn-primary { display: inline-block; padding: 10px 24px; background: #1a73e8; color: #fff; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; transition: background 0.2s; }
.btn-primary:hover { background: #1557b0; }
.btn-secondary { display: inline-block; padding: 10px 24px; background: #fff; color: #333; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 14px; cursor: pointer; transition: background 0.2s; text-decoration: none; }
.btn-secondary:hover { background: #f5f5f5; text-decoration: none; }
.btn-danger { display: inline-block; padding: 10px 24px; background: #dc3545; color: #fff; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; }
.btn-danger:hover { background: #c82333; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 4px; }
.btn-danger.btn-xs { padding: 3px 8px; font-size: 12px; }

/* Layout */
.layout { display: flex; min-height: 100vh; padding-left: 220px; }
.sidebar { width: 220px; background: #1a1a1a; color: #fff; flex-shrink: 0; display: flex; flex-direction: column; height: 100vh; position: fixed; left: 0; top: 0; z-index: 100; }
.sidebar-brand { text-align: center; padding: 20px 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand-logo { margin-bottom: 10px; text-align: center; }
.sidebar-logo { max-width: 80px; max-height: 60px; display: inline-block; margin: 0 auto; }
.sidebar-logo-placeholder { width: 60px; height: 60px; margin: 0 auto 8px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; letter-spacing: 1px; }
.sidebar-brand-wrap { display: block; text-align: center; padding: 0 8px; }
.sidebar-title { font-size: 15px; font-weight: 600; color: #e0e0e0; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-title { font-size: 15px; font-weight: 600; color: #e0e0e0; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-subtitle { font-size: 11px; color: #888; letter-spacing: 0.5px; }
.sidebar-nav { flex: 1; padding: 0; }
.sidebar a { display: block; padding: 12px 20px; color: #b0b0c0; text-decoration: none; font-size: 14px; transition: all 0.2s; }
.sidebar a:hover, .sidebar a.active { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-bottom { padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.08); }
.main { flex: 1; padding: 24px 32px; min-width: 0; }

/* Header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h1 { font-size: 22px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.stat-card .num { font-size: 28px; font-weight: 700; color: #1a73e8; }
.stat-card .label { font-size: 14px; color: #888; margin-top: 4px; }
.stat-card.green .num { color: #1a7d1a; }
.stat-card.orange .num { color: #e67e22; }

/* Table */
.table-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead { background: #f8f9fa; }
th { padding: 12px 16px; text-align: left; font-size: 13px; color: #666; font-weight: 600; border-bottom: 1px solid #e8e8e8; }
td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
tr:hover { background: #f8f9ff; }

/* Badge */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.badge.pending { background: #fff3cd; color: #856404; }
.badge.signed { background: #d4edda; color: #155724; }
.badge.expired { background: #f8d7da; color: #721c24; }

/* Detail */
.detail-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 24px; margin-bottom: 16px; }
.detail-card h2 { font-size: 16px; margin-bottom: 12px; color: #555; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item label { font-size: 12px; color: #999; display: block; }
.detail-item span { font-size: 14px; font-weight: 500; }
.detail-item.full { grid-column: 1 / -1; }

.link-box { background: #f8f9ff; border: 1px solid #d0d5ff; border-radius: 6px; padding: 12px; display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.link-box code { flex: 1; font-size: 13px; word-break: break-all; color: #1a73e8; }

.actions { display: flex; gap: 8px; margin-top: 16px; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; padding: 20px 0; flex-wrap: wrap; }
.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.15s;
}
.pagination .page-link:hover {
    background: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}
.pagination .page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #1a73e8;
    border-radius: 6px;
    background: #1a73e8;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.pagination .page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 32px;
    color: #999;
    font-size: 14px;
    letter-spacing: 2px;
}
.pagination .page-info {
    margin-left: 12px;
    color: #888;
    font-size: 12px;
}
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid #d0d5dd; border-radius: 4px; font-size: 14px; }
.pagination .current { background: #1a73e8; color: #fff; border-color: #1a73e8; }

/* Filter */
.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.filter-bar select, .filter-bar input { padding: 8px 12px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 14px; }
.filter-bar input { flex: 1; max-width: 300px; }

/* Empty */
.empty { text-align: center; padding: 60px 20px; color: #999; }

/* Search */
.search-form { display: flex; gap: 8px; }
.search-form input { padding: 8px 12px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 14px; flex: 1; }

/* Order Cards */
.order-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.order-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 16px; transition: box-shadow 0.2s; }
.order-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.order-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.order-card-no { font-size: 14px; font-weight: 600; color: #333; }
.order-card-no a { color: #1a73e8; }
.order-card .badge { margin-left: auto; }
.order-card-body { font-size: 13px; color: #666; line-height: 1.7; }
.order-card-body .row { display: flex; padding: 2px 0; }
.order-card-body .label { color: #999; width: 64px; flex-shrink: 0; }
.order-card-body .value { flex: 1; word-break: break-word; }
.order-card-items { margin-top: 6px; padding-top: 6px; border-top: 1px solid #f0f0f0; }
.order-card-items-summary { font-size: 12px; color: #999; }
.order-card-actions { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f0f0; display: flex; gap: 8px; }

@media print {
    .no-print { display: none; }
}
