/* ---- 7套主题：body[data-theme] 覆盖 --brand，默认品牌青 ---- */
:root { --brand: #0891b2; --brand-dark: #0e7490; --brand-tint: #e0f2f7; }
body[data-theme="cyan"]   { --brand: #0891b2; --brand-dark: #0e7490; ; --brand-tint: #e0f2f7;}
body[data-theme="green"]  { --brand: #16a085; --brand-dark: #12806a; ; --brand-tint: #e6f5f1;}
body[data-theme="blue"]   { --brand: #2196f3; --brand-dark: #1976d2; ; --brand-tint: #e3f0fd;}
body[data-theme="indigo"] { --brand: #4f46e5; --brand-dark: #4338ca; ; --brand-tint: #eae8fd;}
body[data-theme="orange"] { --brand: #fb8c00; --brand-dark: #e65100; ; --brand-tint: #fef0e0;}
body[data-theme="rose"]   { --brand: #e91e63; --brand-dark: #c2185b; ; --brand-tint: #fde7ef;}
body[data-theme="slate"]  { --brand: #1f2937; --brand-dark: #111827; ; --brand-tint: #eceff3;}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family:"HarmonyOS Sans SC","HarmonyOS Sans",system-ui, -apple-system, sans-serif; background: var(--brand-tint); color: #1e293b; }

/* ===== 登录 ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--brand-tint) 0%, #fbfdfe 100%); }
.login-card { background: #fff; padding: 38px 34px; border-radius: 16px; border: 2px solid var(--brand); box-shadow: 0 12px 34px rgba(0,0,0,.08); width: 320px; max-width: calc(100vw - 32px); }
.login-card h2 { text-align: center; margin-bottom: 28px; color: #1a1a1a; font-size: 26px; }
.login-card h2 b { color: var(--brand); }
.login-card input { width: 100%; padding: 12px 14px; margin-bottom: 16px; border: 1px solid #dfe1e6; border-radius: 10px; font-size: 15px; }
.login-card input:focus { border-color: var(--brand); outline: none; }
.login-card button { width: 100%; padding: 12px; background: var(--brand); color: white; border: none; border-radius: 10px; font-size: 16px; cursor: pointer; }
.login-card button:hover { background: var(--brand-dark); }
.login-card .error { color: #e53e3e; margin-top: 12px; text-align: center; font-size: 14px; }

/* ===== 通用 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.header h1 { font-size: 24px; color: #1e293b; }
.header .user { font-size: 14px; color: #64748b; }
.header .user a { color: #e53e3e; text-decoration: none; margin-left: 12px; }

.btn { display: inline-block; padding: 7px 22px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; line-height: 1.5; cursor: pointer; text-decoration: none; text-align: center; box-sizing: content-box; }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-success { background: var(--brand); color: white; }
.btn-success:hover { background: var(--brand-dark); }
.btn-danger { background: #e53e3e; color: white; }
.btn-danger:hover { background: #c53030; }
.btn-outline { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-outline:hover { background: var(--brand); color: white; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.search-box { display: flex; gap: 10px; align-items: center; }
.search-box input { padding: 8px 16px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; width: 260px; }
.search-box input:focus { border-color: var(--brand); outline: none; }
.search-box select { padding: 8px 16px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; background: white; }

.table-wrapper { overflow-x: auto; border-radius: 16px; border: 1px solid #e2e8f0; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--brand-tint); padding: 12px 16px; text-align: left; font-weight: 600; color: #1e293b; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
td { padding: 10px 16px; border-bottom: 1px solid #e2e8f0; color: #334155; }
tr:hover { background: #f8fafc; }
tr.resolved { opacity: 0.7; }
.clickable { cursor: pointer; }
.clickable:hover { background: #f1f5f9; }

.status { display: inline-block; padding: 2px 12px; border-radius: 40px; font-size: 12px; font-weight: 500; }
.status-待处理 { background: #fef3c7; color: #92400e; }
.status-处理中 { background: #dbeafe; color: #1e40af; }
.status-已解决 { background: #d1fae5; color: #065f46; }
.status-已关闭 { background: #e2e8f0; color: #475569; }

.source { display: inline-block; padding: 2px 10px; border-radius: 40px; font-size: 12px; background: #f1f5f9; color: #475569; }

.empty { text-align: center; padding: 40px; color: #94a3b8; }

/* ===== 详情页 ===== */
.detail-card { background: white; border-radius: 20px; padding: 24px; border: 1px solid #e2e8f0; margin-bottom: 20px; }
.detail-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.detail-row .label { font-weight: 600; color: #64748b; min-width: 100px; }
.detail-row .value { color: #1e293b; }

.timeline { position: relative; padding-left: 24px; margin-top: 16px; }
.timeline-item { margin-bottom: 16px; padding-left: 16px; }
.timeline-item .time { font-size: 12px; color: #64748b; }
.timeline-item .operator { font-weight: 600; color: #1e293b; }
.timeline-item .status-badge { display: inline-block; padding: 2px 10px; border-radius: 40px; font-size: 11px; margin: 0 8px; }
.timeline-item .content { margin-top: 4px; color: #334155; }

.log-form { background: white; border-radius: 16px; padding: 20px; border: 1px solid #e2e8f0; margin-top: 20px; }
.log-form .form-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.log-form select { padding: 8px 16px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; background: white; }
.log-form textarea { flex: 1; padding: 8px 16px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; min-height: 60px; font-family: inherit; min-width: 200px; }
.log-form textarea:focus { border-color: var(--brand); outline: none; }

.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== 新增页 ===== */
.form-card { background: white; border-radius: 20px; padding: 24px; border: 1px solid #e2e8f0; max-width: 1200px; margin: 0 auto; }
.form-card .form-group { margin-bottom: 16px; }
.form-card .form-group label { display: block; font-weight: 600; color: #1e293b; margin-bottom: 4px; font-size: 14px; }
.form-card .form-group input, .form-card .form-group select, .form-card .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; font-family: inherit; }
.form-card .form-group input:focus, .form-card .form-group select:focus, .form-card .form-group textarea:focus { border-color: var(--brand); outline: none; }
.form-card .form-group textarea { min-height: 100px; }
.form-card .form-actions { display: flex; gap: 12px; margin-top: 16px; }

#detailContent { background: white; padding: 20px; }

/* ===== A4 打印 ===== */
@media print {
    .no-print { display: none !important; }
    body { background: white !important; margin: 0; padding: 0; }
    .container { max-width: 100%; padding: 0; margin: 0; }
    .detail-card { border: none !important; padding: 0 !important; margin: 0 !important; }
    .log-form { display: none !important; }
    .detail-actions { display: none !important; }
    .header .user { display: none !important; }
    .header h1 { display: none !important; }
    .header a { display: none !important; }
    .header { margin-bottom: 8px !important; }
    .timeline { border-left-color: #ccc !important; }
    .timeline-item .content img { max-width: 65% !important; max-height: 240px !important; border-radius: 4px; }
    .print-title { display: block !important; }

    #detailContent {
        width: 210mm;
        padding: 10mm 12mm;
        margin: 0 auto;
        background: white;
        font-size: 12pt;
        line-height: 1.8;
        box-sizing: border-box;
    }
    #detailContent .detail-row { margin-bottom: 4px; }
    #detailContent .detail-row .label { font-weight: 600; color: #333; min-width: 70px; display: inline-block; }
    #detailContent .detail-row .value { color: #000; }
    #detailContent .status { font-size: 11pt; padding: 2px 12px; border-radius: 40px; }
    #detailContent .timeline-item { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #eee; break-inside: avoid; page-break-inside: avoid; }
    #timelineCard h2 { break-after: avoid; page-break-after: avoid; }
    #detailContent .timeline-item .time { font-size: 10pt; color: #555; }
    #detailContent .timeline-item .operator { font-weight: 600; }
    #detailContent .timeline-item .content { margin-top: 4px; }
}

.verify-row { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.verify-row input { flex: 1; margin-bottom: 0 !important; }
.verify-row img { flex-shrink: 0; }

.btn-danger-o { background: transparent; color: #e53e3e; border: 1px solid #e53e3e; }
.btn-danger-o:hover { background: #e53e3e; color: white; }
