:root {
  color-scheme: light;
  --page:#fff8f1; --panel:#fff; --ink:#35261d; --muted:#77675b;
  --line:#ecded0; --brand:#c44a0c; --brand-dark:#9f3405; --soft:#fff0df;
  --danger:#a3322c; --danger-soft:#fff0ee; --success:#216448; --success-soft:#edf7f0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  font-size:16px; line-height:1.55;
}
* { box-sizing:border-box; }
[hidden] { display:none!important; }
body { margin:0; background:var(--page); color:var(--ink); }
button,input,textarea,select { font:inherit; }
button,input,textarea,select,a { -webkit-tap-highlight-color:transparent; }
button,a,summary { touch-action:manipulation; }
button { cursor:pointer; }
button:disabled { cursor:not-allowed; opacity:.5; }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible { outline:3px solid #d18745; outline-offset:3px; }
h1,h2,h3,p { margin:0; }
h1 { font-size:28px; line-height:1.35; letter-spacing:-.6px; }
h2 { font-size:20px; line-height:1.4; }
h3 { font-size:16px; line-height:1.45; }
a { color:var(--brand-dark); text-underline-offset:3px; }
.skip-link { position:absolute; left:12px; top:-100px; padding:10px 15px; background:#fff; z-index:10; }
.skip-link:focus { top:10px; }
.app-shell { min-height:100vh; display:flex; flex-direction:column; }
.app-header { background:#fffcf8; border-bottom:1px solid var(--line); }
.header-inner { max-width:1040px; margin:auto; padding:20px 28px 14px; display:flex; gap:18px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.brand { display:flex; gap:11px; align-items:center; color:var(--ink); text-decoration:none; min-width:0; }
.brand-mark { width:44px; height:44px; border-radius:14px; display:grid; place-items:center; background:var(--brand); color:#fff; font-size:21px; font-weight:750; flex:none; }
.brand-copy { min-width:0; }
.brand-name { font-size:18px; font-weight:700; overflow-wrap:anywhere; }
.brand-subtitle { display:block; font-size:11px; color:var(--muted); letter-spacing:1.6px; margin-top:2px; }
.account-tools { display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-width:0; font-size:13px; }
.account-name { display:flex; align-items:center; gap:7px; min-width:0; overflow-wrap:anywhere; }
.role-tag { display:inline-block; font-size:11px; color:var(--brand-dark); background:var(--soft); border:1px solid #efd0b1; padding:2px 7px; border-radius:20px; white-space:nowrap; }
.text-button { border:0; background:transparent; color:var(--brand-dark); font-size:13px; padding:6px 0; min-height:36px; text-decoration:none; }
.app-nav { max-width:1040px; margin:auto; padding:0 28px 13px; display:flex; gap:7px; flex-wrap:wrap; }
.app-nav button { border:0; background:transparent; color:var(--muted); border-radius:10px; padding:9px 14px; min-height:40px; font-size:13px; font-weight:600; }
.app-nav button[aria-current="page"] { color:var(--brand-dark); background:var(--soft); }
.page-wrap { width:100%; max-width:1040px; margin:0 auto; padding:27px 28px 35px; flex:1; }
.app-footer { max-width:1040px; width:100%; margin:auto; padding:15px 28px 24px; display:flex; justify-content:center; gap:7px 12px; flex-wrap:wrap; color:var(--muted); font-size:12px; }
.app-footer a { margin-left:6px; }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:20px; padding:24px; min-width:0; }
.panel + .panel { margin-top:18px; }
.muted { color:var(--muted); }
.subtitle { color:var(--muted); font-size:14px; margin-top:8px; }
.small { font-size:12px; }
.page-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:23px; flex-wrap:wrap; }
.section-title { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin:25px 0 13px; }
.section-title .muted { font-size:12px; }
.button { display:inline-flex; justify-content:center; align-items:center; gap:7px; padding:11px 17px; min-height:44px; border:1px solid #d9c7b5; border-radius:11px; background:#fff; color:var(--ink); text-decoration:none; font-size:14px; font-weight:600; text-align:center; }
.button:hover:not(:disabled) { background:#fff8f1; border-color:#cfa27b; }
.button-primary { color:#fff; background:var(--brand); border-color:var(--brand); }
.button-primary:hover:not(:disabled) { background:var(--brand-dark); border-color:var(--brand-dark); }
.button-danger { color:var(--danger); border-color:#dfb9b4; background:#fff; }
.button-danger:hover:not(:disabled) { background:var(--danger-soft); border-color:#c88f87; }
.button-small { padding:7px 11px; min-height:36px; font-size:12px; }
.button-wide { width:100%; }
.actions { display:flex; gap:9px; flex-wrap:wrap; margin-top:20px; }
.actions .button { flex:1; min-width:120px; }
.notice { margin-bottom:20px; padding:13px 16px; border-radius:12px; font-size:13px; color:var(--success); background:var(--success-soft); display:flex; gap:10px; justify-content:space-between; align-items:center; flex-wrap:wrap; overflow-wrap:anywhere; }
.notice-error { background:var(--danger-soft); color:var(--danger); }
.notice-info { color:#755021; background:#fff0d8; }
.notice .text-button { color:inherit; padding:0; }
.form-error { background:var(--danger-soft); color:var(--danger); border-radius:10px; padding:12px 13px; font-size:13px; margin-bottom:17px; overflow-wrap:anywhere; }
.form-note { background:#f8f1e9; color:#725c48; border-radius:11px; padding:12px 14px; margin:16px 0; font-size:12px; overflow-wrap:anywhere; }
.field { display:block; min-width:0; margin-bottom:18px; }
.field-label { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:5px 12px; font-weight:600; font-size:13px; margin-bottom:7px; }
.field-label small { font-size:11px; color:var(--muted); font-weight:400; }
.field input,.field textarea,.field select,.search-form input,.search-form select { display:block; width:100%; min-width:0; padding:11px 12px; border:1px solid #d9c8b6; border-radius:11px; background:#fff; color:var(--ink); font-size:16px; }
.field textarea { resize:vertical; min-height:135px; line-height:1.6; }
.field input[readonly],.field textarea[readonly],.field select:disabled { background:#f7f1eb; color:#796b60; }
[aria-invalid="true"] { border-color:var(--danger)!important; }
.field-hint { display:block; color:var(--muted); font-size:12px; margin-top:7px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 18px; }
.auth-wrap { max-width:430px; margin:18px auto; }
.auth-heading { margin-bottom:26px; }
.eyebrow { color:var(--brand-dark); font-size:11px; letter-spacing:1.7px; font-weight:650; margin-bottom:9px; }
.auth-heading h1 { font-size:27px; }
.auth-switch { margin-top:22px; padding-top:16px; border-top:1px solid var(--line); display:flex; align-items:center; gap:10px; justify-content:center; flex-wrap:wrap; font-size:13px; }
.auth-intro { margin-top:20px; font-size:12px; text-align:center; color:var(--muted); }
.hero { background:linear-gradient(120deg,#a63a0b,#ce5010); color:#fff; padding:30px; border-radius:23px; }
.hero .eyebrow { color:#ffe6d0; }
.hero h1 { font-size:29px; max-width:650px; }
.hero p { font-size:14px; color:#fff0e3; margin-top:10px; }
.hero-bottom { display:flex; align-items:center; gap:16px; justify-content:space-between; flex-wrap:wrap; margin-top:24px; padding-top:18px; border-top:1px solid #ffffff4a; font-size:13px; }
.hero .button { background:#fff7ed; border-color:#fff7ed; color:var(--brand-dark); }
.category-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.category-card { min-width:0; display:flex; align-items:center; gap:10px; text-align:left; padding:18px 14px; background:#fff; border:1px solid var(--line); border-radius:16px; min-height:86px; }
.category-card:hover { border-color:#d6a174; background:#fffdf8; }
.category-mark { width:37px; height:37px; display:grid; place-items:center; flex:none; border-radius:12px; background:var(--soft); color:var(--brand-dark); font-size:13px; font-weight:700; }
.category-copy { min-width:0; overflow-wrap:anywhere; }
.category-copy strong { display:block; font-size:14px; }
.category-copy small { display:block; margin-top:3px; font-size:11px; color:var(--muted); }
.search-form { display:grid; grid-template-columns:minmax(145px,.6fr) minmax(0,1.5fr) auto; gap:12px; align-items:end; margin-bottom:18px; }
.search-form label { min-width:0; }
.search-form label > span { font-size:12px; font-weight:600; display:block; margin-bottom:6px; }
.ticket-list { display:grid; gap:12px; }
.ticket-card { display:block; min-width:0; width:100%; text-align:left; padding:19px 21px; border:1px solid var(--line); border-radius:17px; background:#fff; color:var(--ink); }
.ticket-card:hover { border-color:#d7ad88; }
.ticket-top,.ticket-bottom { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:7px 15px; font-size:12px; color:var(--muted); }
.ticket-title { display:block; font-size:16px; margin:11px 0 8px; overflow-wrap:anywhere; }
.ticket-bottom { font-size:12px; }
.ticket-bottom .view-link { color:var(--brand-dark); }
.ticket-number { overflow-wrap:anywhere; }
.status { display:inline-flex; align-items:center; gap:6px; padding:4px 9px; border-radius:20px; font-size:12px; color:#86510b; background:#fff0cd; white-space:nowrap; }
.status::before { content:""; width:5px; height:5px; border-radius:50%; background:currentColor; }
.status-Processing { background:#e9f3fb; color:#275e88; }
.status-Answered { background:#e6f4ec; color:#236344; }
.status-Closed { background:#f0eeeb; color:#625c56; }
.status-Rejected { background:#fdeeea; color:#a4372c; }
.status-Unknown { background:#f0eeeb; color:#625c56; }
.pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:22px; font-size:12px; color:var(--muted); }
.pagination-buttons { display:flex; gap:8px; }
.empty-state { padding:40px 24px; border:1px solid var(--line); border-radius:18px; background:#fff; text-align:center; }
.empty-state h2 { font-size:19px; margin-bottom:8px; }
.empty-state p { color:var(--muted); font-size:13px; }
.empty-state .button { margin-top:20px; }
.loading-panel { display:flex; gap:10px; align-items:center; justify-content:center; padding:48px 16px; color:var(--muted); font-size:14px; }
.loading-dot { width:8px; height:8px; border-radius:50%; background:var(--brand); }
.back-button { display:inline-flex; align-items:center; gap:6px; margin-bottom:15px; padding:3px 0; min-height:36px; background:transparent; border:0; color:var(--muted); font-size:13px; }
.form-panel { max-width:740px; margin:auto; }
.file-control { border:1px dashed #d9c4af; border-radius:12px; padding:14px; background:#fffcf8; }
.file-control input[type="file"] { display:block; width:100%; min-width:0; border:0; padding:0; border-radius:0; background:transparent; font-size:13px; }
.file-control input::file-selector-button { border:1px solid #dac8b4; border-radius:8px; padding:8px 10px; margin-right:10px; background:#fff; color:var(--ink); font:inherit; cursor:pointer; }
.file-preview { display:flex; align-items:center; gap:13px; margin-top:13px; min-width:0; }
.file-preview img { width:74px; height:74px; object-fit:cover; border-radius:10px; border:1px solid var(--line); }
.file-preview-copy { min-width:0; flex:1; overflow-wrap:anywhere; font-size:13px; }
.file-preview-copy small { display:block; font-size:11px; color:var(--muted); margin-top:4px; }
.detail-heading { margin-bottom:20px; }
.detail-heading h1 { font-size:25px; margin:13px 0 12px; overflow-wrap:anywhere; }
.detail-meta { display:flex; flex-wrap:wrap; gap:6px 18px; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.detail-grid { display:grid; grid-template-columns:minmax(0,1fr) 290px; gap:20px; align-items:start; }
.detail-main,.detail-aside { min-width:0; }
.message-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:13px; }
.message-heading time { font-size:12px; color:var(--muted); }
.message-text { white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.75; }
.reply-panel { background:#fff2e4; border-color:#edcfac; }
.attachment-box { margin:20px 0 0; padding-top:16px; border-top:1px solid var(--line); }
.attachment-box img { display:block; width:auto; max-width:100%; max-height:340px; object-fit:contain; border-radius:11px; margin-bottom:10px; }
.attachment-caption { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:12px; overflow-wrap:anywhere; }
.action-panel h2 { margin-bottom:8px; font-size:18px; }
.action-panel .field { margin-top:17px; }
.action-panel .field textarea { min-height:140px; }
.action-panel + .action-panel { margin-top:18px; }
.timeline { list-style:none; margin:18px 0 0; padding:0; }
.timeline li { position:relative; padding:0 0 20px 20px; border-left:1px solid #e4d4c3; margin-left:4px; overflow-wrap:anywhere; }
.timeline li:last-child { padding-bottom:0; border-color:transparent; }
.timeline li::before { content:""; width:7px; height:7px; border-radius:50%; background:#cb8550; position:absolute; left:-4px; top:6px; }
.timeline strong { font-size:13px; font-weight:600; }
.timeline p { color:var(--muted); font-size:11px; margin-top:3px; }
.state-message { font-size:13px; color:var(--muted); }
.state-message strong { color:var(--ink); }
.followup-details { border-top:1px solid var(--line); padding-top:16px; margin-top:19px; }
.followup-details summary { cursor:pointer; font-size:14px; color:var(--brand-dark); min-height:28px; }
.followup-details .field { margin-top:16px; }
.access-panel { max-width:550px; margin:35px auto; text-align:center; }
.access-panel p { margin-top:12px; color:var(--muted); font-size:14px; }
@media(max-width:800px) {
  .category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .detail-grid { grid-template-columns:minmax(0,1fr); }
  .detail-aside { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; }
  .detail-aside .panel + .panel { margin-top:0; }
}
@media(max-width:540px) {
  h1 { font-size:24px; }
  .header-inner { padding:17px 18px 12px; gap:12px; }
  .brand-name { font-size:16px; }
  .brand-mark { width:39px; height:39px; border-radius:12px; }
  .account-tools { width:100%; justify-content:space-between; padding-left:1px; }
  .app-nav { padding:0 15px 11px; gap:4px; }
  .app-nav button { flex:1; padding:9px; font-size:12px; }
  .page-wrap { padding:20px 16px 25px; }
  .app-footer { padding:13px 16px 22px; font-size:11px; }
  .panel { padding:20px 17px; border-radius:17px; }
  .hero { padding:23px 20px; border-radius:19px; }
  .hero h1 { font-size:25px; }
  .hero p { font-size:13px; }
  .hero-bottom { font-size:12px; }
  .category-grid { gap:9px; }
  .category-card { padding:15px 11px; gap:8px; min-height:83px; }
  .category-mark { width:31px; height:33px; border-radius:10px; font-size:12px; }
  .category-copy strong { font-size:13px; }
  .form-grid { grid-template-columns:minmax(0,1fr); }
  .search-form { grid-template-columns:minmax(0,1fr) auto; gap:10px; }
  .search-form .status-filter { grid-column:1/-1; }
  .search-form .button { padding-left:15px; padding-right:15px; }
  .ticket-card { padding:16px; }
  .ticket-title { font-size:15px; }
  .page-title-row { gap:14px; }
  .detail-heading h1 { font-size:22px; }
  .auth-wrap { margin:8px auto; }
  .auth-heading h1 { font-size:25px; }
  .file-preview { align-items:flex-start; flex-wrap:wrap; }
  .file-preview-copy { flex-basis:calc(100% - 90px); }
}
@media(pointer:coarse) { .text-button,.app-nav button,.back-button,.button-small { min-height:44px; } .followup-details summary { padding:7px 0; } }
@media(prefers-reduced-motion:no-preference) { button,a { transition:background-color .15s,border-color .15s; } }
