* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; background: #f0f4f8; color: #1e293b; }

/* ===== 登录 ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1e5a74 0%, #2c7da0 100%); }
.login-card { background: white; padding: 40px 48px; border-radius: 24px; box-shadow: 0 20px 35px rgba(0,0,0,0.2); width: 100%; max-width: 400px; }
.login-card h2 { text-align: center; margin-bottom: 30px; color: #1e5a74; }
.login-card input { width: 100%; padding: 12px 16px; margin-bottom: 16px; border: 1px solid #cbd5e1; border-radius: 12px; font-size: 16px; }
.login-card input:focus { border-color: #2c7da0; outline: none; }
.login-card button { width: 100%; padding: 12px; background: #2c7da0; color: white; border: none; border-radius: 12px; font-size: 16px; cursor: pointer; }
.login-card button:hover { background: #1e5a74; }
.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: 8px 20px; border: none; border-radius: 40px; font-size: 14px; cursor: pointer; text-decoration: none; text-align: center; }
.btn-primary { background: #2c7da0; color: white; }
.btn-primary:hover { background: #1e5a74; }
.btn-success { background: #10b981; color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #e53e3e; color: white; }
.btn-danger:hover { background: #c53030; }
.btn-outline { background: transparent; color: #2c7da0; border: 1px solid #2c7da0; }
.btn-outline:hover { background: #2c7da0; 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: #2c7da0; 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: #f8fafc; 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: 16px; 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; border-left: 2px solid #e2e8f0; 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: #2c7da0; outline: none; }

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

/* ===== 新增页 ===== */
.form-card { background: white; border-radius: 16px; padding: 24px; border: 1px solid #e2e8f0; max-width: 700px; 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: #2c7da0; 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; }
    .print-title { display: block !important; }

    #detailContent {
        width: 210mm;
        min-height: 297mm;
        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; }
    #detailContent .timeline-item .time { font-size: 10pt; color: #555; }
    #detailContent .timeline-item .operator { font-weight: 600; }
    #detailContent .timeline-item .content { margin-top: 4px; }
}