﻿
:root { --tt-ink:#172c43; --tt-muted:#4b6278; --tt-accent:#125887; --tt-line:#cfdae4; }
body.topthink-client, body.topthink-staff { background:#edf3f7; color:var(--tt-ink); font:15px/1.55 "Microsoft YaHei","PingFang SC",system-ui,sans-serif; }
.topthink-client #container { box-sizing:border-box; width:min(100% - 32px, 880px); margin:24px auto 0; border:1px solid var(--tt-line); border-radius:14px; background:#fff; overflow:hidden; }
.topthink-client #header, .topthink-staff #header { min-height:66px; height:auto; padding:12px 24px; box-sizing:border-box; background:#102e48; color:white; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.topthink-client #header a, .topthink-staff #header a { color:white; }
.topthink-client #header #logo, .topthink-staff #header #logo { order:-1; text-decoration:none; height:auto; }
.topthink-brand { display:inline-block; font-weight:700; font-size:19px; letter-spacing:.025em; }
.topthink-client #header p, .topthink-staff #header p { margin:0; }
.topthink-client #header p:empty { display:none; }
.topthink-client #nav { display:flex; flex-wrap:wrap; padding:7px 16px; margin:0; height:auto; min-height:0; border:0; border-bottom:1px solid var(--tt-line); background:#f6f9fc; }
.topthink-client #nav li { float:none; }
.topthink-client #nav li a { padding:8px 12px; background:none; height:auto; line-height:1.5; border:0; color:var(--tt-ink); }
.topthink-client #nav li a.active { background:#e2eef7; color:#104c78; border-radius:7px; }
.topthink-client #content { padding:clamp(16px,4vw,36px); min-height:0; }
.topthink-client h1 { color:var(--tt-ink); font-size:clamp(25px,5vw,34px); margin:0 0 8px; line-height:1.3; }
.topthink-client #ticketForm table { width:100%; max-width:100%; margin:0; table-layout:auto; }
.topthink-client #ticketForm td { overflow-wrap:anywhere; }
.topthink-client #ticketForm input:not([type=hidden],[type=checkbox],[type=radio],[type=submit],[type=reset],[type=button]), .topthink-client #ticketForm select, .topthink-client #clientLogin input:not([type=hidden],[type=submit]) { box-sizing:border-box; max-width:100%; min-height:40px; padding:7px 9px; border:1px solid #95aabf; border-radius:6px; background:#fff; color:var(--tt-ink); }
.topthink-client #ticketForm input[type=submit], .topthink-client #clientLogin input[type=submit], .topthink-client a.tt-button { display:inline-block; background:var(--tt-accent); border:1px solid var(--tt-accent); border-radius:7px; padding:8px 15px; color:#fff; font:inherit; text-decoration:none; }
.topthink-client :focus-visible, .topthink-staff :focus-visible { outline:2px solid #1973ab; outline-offset:3px; }
.topthink-client .topthink-upload-hint { padding:11px 14px; background:#edf5fb; color:#284b68; border:1px solid #c9ddeb; border-radius:7px; }
.topthink-client #footer { width:auto; margin:18px 12px; }
.topthink-client .tt-entry-links { display:flex; flex-wrap:wrap; gap:10px; margin:18px 0; }
.topthink-client #landing_page .main-content { width:auto; float:none; }
.topthink-client #landing_page .sidebar { display:none; }
.topthink-staff #container { width:min(100% - 32px,1320px); min-width:0; margin:20px auto; background:white; border:1px solid var(--tt-line); border-radius:10px; }
.topthink-staff #content { overflow-x:auto; }
.topthink-staff #nav { border-color:var(--tt-line); }
.topthink-staff #sub_nav { background:#edf4f9; }
@media(max-width:600px) {
 .topthink-client #container { width:calc(100% - 16px); margin-top:8px; }
 .topthink-client #header { padding:12px 14px; }
 .topthink-client #nav { padding-inline:5px; }
 .topthink-client #ticketForm tr { display:block; }
 .topthink-client #ticketForm td { display:block; width:auto!important; }
 .topthink-client #ticketForm input:not([type=hidden],[type=checkbox],[type=radio],[type=submit],[type=reset],[type=button]), .topthink-client #ticketForm select { width:100%; }
 .topthink-client #ticketForm .redactor-toolbar { display:flex; flex-wrap:wrap; }
 .topthink-client #clientLogin .login-box, .topthink-client #clientLogin .instructions { display:block; box-sizing:border-box; float:none; width:100%; max-width:100%; }
}


.topthink-client #header > div, .topthink-staff #header #info { float:none; position:static; width:auto; max-width:100%; margin:0; padding:0; background:none; box-shadow:none; border:0; color:#fff; text-align:start; }
.topthink-client #header #logo, .topthink-staff #header #logo { float:none; position:static; margin:0; padding:0; width:auto; max-width:100%; }
.topthink-client #header a:focus-visible, .topthink-staff #header a:focus-visible { outline-color:#b9e5ff; }
.topthink-client #nav { box-shadow:none; }
.topthink-client #ticketForm .redactor-placeholder::after, .topthink-client #ticketForm .redactor-placeholder::before { color:#4b6278; }
.topthink-client #ticketForm input[type=reset], .topthink-client #ticketForm input[type=button] { min-height:36px; padding:5px 11px; border:1px solid #95aabf; border-radius:6px; background:#f6f9fc; color:#244563; font:inherit; }

.topthink-client #ticketForm textarea.draft, .topthink-client #reply textarea#message {
    box-sizing: border-box; width: 100%; padding: 10px 12px; resize: vertical;
    border: 1px solid #95aabf; border-radius: 6px; color: var(--tt-ink); font: inherit;
}

.topthink-staff .tt-portal-reply-hint {
    padding: 10px 14px; margin: 8px 0 0; border-radius: 7px;
    background: #edf5fb; color: #284b68;
}
.topthink-staff #reply textarea#response:not(.richtext) {
    box-sizing: border-box; width: 100%; padding: 10px 12px; resize: vertical;
    border: 1px solid #95aabf; border-radius: 6px; color: var(--tt-ink); font: inherit;
}

.topthink-staff .tt-portal-reply input[type=submit] {
    min-height: 37px; padding: 7px 15px; background: var(--tt-accent); color: #fff;
    border: 1px solid var(--tt-accent); border-radius: 6px; font: inherit;
}
.topthink-staff .tt-portal-reply input[type=submit]:hover { background: #104a72; }

.topthink-staff .tt-workspace { max-width: 960px; margin: 24px auto; }
.topthink-staff .tt-workspace h1 { margin: 0 0 18px; color: var(--tt-ink); }
.topthink-staff .tt-workspace-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.topthink-staff .tt-workspace-links a {
    display: grid; gap: 4px; padding: 16px; border: 1px solid var(--tt-line);
    border-radius: 8px; background: #f7fafc; color: var(--tt-accent); text-decoration: none;
}
.topthink-staff .tt-workspace-links a:hover { border-color: var(--tt-accent); background: #edf5fb; }
.topthink-staff .tt-workspace-links a strong { font-size: 17px; }
.topthink-staff .tt-workspace-links a span { color: var(--tt-muted); }
.topthink-staff .tt-workspace-secondary { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
@media(max-width:600px) {
    .topthink-staff .tt-workspace-links { grid-template-columns: 1fr; }
}

.topthink-client .tt-ticket-summary {
    padding: clamp(14px, 3vw, 22px);
    border: 1px solid var(--tt-line);
    border-radius: 10px;
    background: #f7fafc;
}
.topthink-client .tt-ticket-summary h1 { margin: 8px 0 12px; overflow-wrap: anywhere; }
.topthink-client .tt-ticket-back { color: var(--tt-accent); }
.topthink-client .tt-ticket-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; color: var(--tt-muted); }
.topthink-client .tt-ticket-state { padding: 3px 9px; background: #e4eff8; color: #15496f; border-radius: 5px; }
.topthink-client .tt-ticket-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; }
.topthink-client .tt-ticket-progress li { display: flex; align-items: center; gap: 7px; padding: 8px 6px; border-top: 2px solid #cfdae4; color: var(--tt-muted); }
.topthink-client .tt-ticket-progress li span { display: inline-grid; place-items: center; min-width: 21px; height: 21px; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; }
.topthink-client .tt-ticket-progress .is-current { color: #0e4e7a; border-color: #1973ab; font-weight: 700; }
.topthink-client .tt-ticket-progress .is-past { color: #1f695e; border-color: #83b6a9; }
.topthink-client .tt-ticket-timeline .thread-entry { margin: 0 0 16px; }
.topthink-client .tt-ticket-timeline .thread-entry > .header { margin: 0; border: 1px solid #cdddec; border-bottom: 0; border-radius: 9px 9px 0 0; background: #eaf3fb; color: #194c75; box-shadow: none; }
.topthink-client .tt-ticket-timeline .thread-entry.response > .header { background: #e7f4ef; color: #225e50; }
.topthink-client .tt-ticket-timeline .thread-entry > .thread-body { margin: 0; border: 1px solid #cdddec; border-radius: 0 0 9px 9px; box-shadow: none; overflow-wrap: anywhere; }
.topthink-client .tt-ticket-timeline .thread-entry > .header time { margin-left: 6px; font-size: 13px; }
.topthink-client .tt-ticket-timeline .thread-entry > span.avatar { display: none; }
.topthink-client #reply input[type=submit] { padding: 8px 14px; color: #fff; background: var(--tt-accent); border: 1px solid var(--tt-accent); border-radius: 6px; font: inherit; cursor: pointer; }
@media(max-width:600px) {
    .topthink-client .tt-ticket-progress li { flex-wrap: wrap; gap: 4px; padding-inline: 0; }
    .topthink-client .tt-ticket-timeline .attachment-info { display: inline-block; max-width: 100%; }
}


.topthink-client #reply { box-sizing: border-box; width: 100%; }
.topthink-client #reply textarea#message { width: 100%; max-width: 100%; min-width: 0; }
.topthink-client .tt-ticket-timeline .thread-entry.avatar > .header,
.topthink-client .tt-ticket-timeline .thread-entry.avatar > .thread-body {
    margin-inline: 0;
}

.topthink-client .thread-entry .tt-image-attachment {
    display: inline-block; margin: 0 10px 8px 0; max-width: 100%; vertical-align: top;
}
.topthink-client .tt-attachment-preview {
    display: block; box-sizing: border-box; width: min(192px, 100%); margin: 4px 0 6px;
    border: 1px solid var(--tt-line); border-radius: 6px; overflow: hidden; background: #edf4f9;
}
.topthink-client .tt-attachment-preview img {
    display: block; width: 100%; height: 112px; object-fit: contain;
}
.topthink-client .tt-attachment-preview:hover { border-color: var(--tt-accent); }

.topthink-client #header #logo, .topthink-staff #header #logo { display: inline-flex; align-items: center; gap: 10px; }
.topthink-client #header .tt-support-logo, .topthink-staff #header .tt-support-logo {
    display: block; width: 96px; height: 32px; object-fit: contain;
    background: #fff; border-radius: 5px;
}
.topthink-client .tt-ticket-state[data-status="waiting"] { background: #fff1bf; color: #674900; }
.topthink-client .tt-ticket-state[data-status="working"] { background: #fce5e6; color: #91262b; }
.topthink-client .tt-ticket-state[data-status="answered"] { background: #dbeeff; color: #124d7b; }
.topthink-client .tt-ticket-state[data-status="closed"] { background: #e8edf2; color: #41566c; }

.topthink-client #header #logo, .topthink-staff #header #logo { gap: 9px; white-space: nowrap; }
.topthink-client #header #logo .tt-support-logo, .topthink-staff #header #logo .tt-support-logo { width: 108px; height: 36px; }
.topthink-client #header #logo .tt-brand-divider, .topthink-staff #header #logo .tt-brand-divider { color: #a8c0d4; font-size: 18px; line-height: 1; }
.topthink-client #header #logo .topthink-brand, .topthink-staff #header #logo .topthink-brand { font-size: 17px; }

.topthink-staff #tt-presence { padding: 6px 16px; color: #244563; background: #e8f4f2; border-bottom: 1px solid #cbdedb; }
.topthink-staff .tt-ticket-workbench { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 0 12px; }
.topthink-staff .tt-ticket-workbench a { padding: 5px 9px; border: 1px solid #c4d6e5; border-radius: 5px; color: #124d7b; }
.topthink-staff .tt-ticket-workbench a:hover { background: #eaf4fc; text-decoration: none; }
.topthink-staff .tt-ticket-handoff { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 0; }

/* Shared layout for narrow staff, admin and client screens. */
.tt-claim-button {
    min-height: 36px; padding: 6px 12px; border: 1px solid var(--tt-accent);
    border-radius: 6px; background: var(--tt-accent); color: white;
    font: inherit; white-space: nowrap; cursor: pointer;
}
.tt-claim-button:hover { background: #104a72; }
.topthink-staff .tt-ticket-workbench a[aria-current="page"] {
    background: #e2eef7; border-color: #8aafca; font-weight: 700;
}
@media (max-width: 800px) {
    .topthink-staff #container { width: calc(100% - 16px); margin: 8px auto; box-sizing: border-box; }
    .topthink-staff #header { padding: 10px 12px; }
    .topthink-staff #header #info { overflow-wrap: anywhere; }
    .topthink-staff #nav, .topthink-staff #sub_nav {
        display: flex; flex-wrap: wrap; gap: 3px; height: auto; min-height: 0;
        box-sizing: border-box; width: 100%; padding: 4px 8px;
    }
    .topthink-staff #nav > li, .topthink-staff #sub_nav > li { float: none; width: auto; margin: 0; }
    .topthink-staff #nav > li > a, .topthink-staff #sub_nav > li > a {
        display: block; width: auto; height: auto; min-height: 36px; line-height: 1.4;
        box-sizing: border-box; padding-top: 9px; padding-bottom: 8px;
    }
    .topthink-staff #nav > li > a { padding-inline: 10px; }
    .topthink-staff #content { min-width: 0; padding: 10px; }
    .topthink-staff #footer { width: auto; max-width: 100%; }
    .topthink-staff #content table:not(.tt-claim-list),
    .topthink-client #content table:not(#ticketForm table),
    .topthink-staff .dialog table {
        max-width: 100%; overflow-x: auto;
    }
    .topthink-staff #content table:is(.list, .form_table, .dashboard-stats):not(.tt-claim-list),
    .topthink-client #content table#ticketInfo { display: block; }
    .topthink-staff #content .ticket_info, .topthink-staff #content .ticket_info table { width: 100%; }
    .topthink-staff #content .ticket_info > tbody > tr > td { display: block; width: 100%; box-sizing: border-box; }
    .topthink-staff #content :is(input,select,textarea), .topthink-staff .dialog :is(input,select,textarea),
    .topthink-staff #content .select2-container { max-width: 100%; box-sizing: border-box; }
    .topthink-staff #content .sticky.bar { position: relative; top: auto; }
    .topthink-staff #content .thread-body { overflow-wrap: anywhere; }
    .topthink-staff .dialog:is(#popup,#advanced-search,.size-normal,.size-large,.size-xl) {
        box-sizing: border-box; width: min(100% - 24px, 720px) !important;
        left: 50% !important; margin-left: 0 !important; transform: translateX(-50%);
        max-height: calc(100dvh - 32px); overflow: auto;
    }
    .topthink-staff .tt-ticket-handoff details { width: 100%; }
    .topthink-staff .tt-ticket-handoff form label { flex: 1 1 150px; }
    .topthink-staff .tt-ticket-handoff form label :is(select,input) { display: block; width: 100%; }
    .topthink-staff .tt-claim-list { display: block; width: 100%; border: 0; background: transparent; }
    .topthink-staff .tt-claim-list thead {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
    }
    .topthink-staff .tt-claim-list :is(tbody,tfoot) { display: block; }
    .topthink-staff .tt-claim-list tbody tr {
        display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 10px;
        margin: 0 0 10px; padding: 12px; border: 1px solid var(--tt-line);
        border-radius: 8px; background: #fff;
    }
    .topthink-staff .tt-claim-list tbody td {
        min-width: 0; padding: 0; border: 0; background: transparent;
        color: var(--tt-ink); overflow-wrap: anywhere;
    }
    .topthink-staff .tt-claim-list tbody td[data-label]::before {
        content: attr(data-label); display: block; color: var(--tt-muted); font-size: 12px;
    }
    .topthink-staff .tt-claim-list tbody td:is([data-label="标题"],[data-label="问题标题"],[data-label="操作"],[data-label="最近更新"],[data-label="已创建"]) {
        grid-column: 1 / -1;
    }
    .topthink-staff .tt-claim-list tbody td:is([data-label="标题"],[data-label="问题标题"]) {
        grid-row: 1; font-size: 16px; font-weight: 700;
    }
    .topthink-staff .tt-claim-list tbody td[data-label="操作"]::before,
    .topthink-staff .tt-claim-list tbody td:is([data-label="标题"],[data-label="问题标题"])::before { content: none; }
    .topthink-staff .tt-claim-list .tt-claim-button { width: 100%; min-height: 44px; }
}

.topthink-staff button.tt-claim-button[type=submit] {
    background: var(--tt-accent); color: #fff; box-shadow: none; font-weight: 600;
}
.topthink-staff button.tt-claim-button[type=submit]:hover { background: #104a72; }
@media (max-width: 800px) {
    .topthink-staff #customQ_nav, .topthink-staff #customQ_nav .jb-overflowmenu-container { width: 100%; }
    .topthink-staff #nav > li:is(.active,.inactive) { width: auto; }
    .topthink-staff #content table.two-column { width: 100% !important; }
    .topthink-staff #content table.two-column > tbody > tr > td {
        display: block; box-sizing: border-box; width: 100%;
    }
    .topthink-staff #content select, .topthink-staff #content input:not([type=checkbox],[type=radio],[type=hidden]) { min-height: 34px; }
    .topthink-staff #response_options .tab_content { min-width: 0; }
    .topthink-staff #response_options :is(textarea, .redactor-box) { max-width: 100%; }
    .topthink-staff .tt-claim-list tbody td[data-label="操作"] { margin-top: 3px; }
}
@media (max-width: 800px) {
    .topthink-staff #pjax-container:has(.tt-claim-list) #customQ_nav { display: none; }
    .topthink-staff #content .tt-claim-list tbody tr > td:not([style]) { background: transparent; }
    .topthink-staff #content .tt-claim-list tbody td[data-label="优先级"] { background: transparent !important; }
    .topthink-staff #content .tt-claim-list td[data-label="标题"] a,
    .topthink-staff #content .tt-claim-list td[data-label="问题标题"] a { white-space: normal; }
    .topthink-staff #content .tt-claim-list tbody td:empty { display: none; }
    .topthink-staff #content .tt-ticket-workbench + p { margin: 0 0 12px; color: var(--tt-muted); }
    .topthink-staff #content #basic_search input.basic-search { max-width: calc(100% - 40px); }
}

.topthink-staff .thread-body .tt-staff-attachments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr));
    gap: 8px;
}
.topthink-staff .thread-body .tt-staff-attachments .attachment-info {
    width: auto;
    min-width: 0;
    margin: 0;
}
.topthink-staff .tt-attachment-preview {
    display: block;
    max-width: 200px;
    margin-bottom: 5px;
    border: 1px solid var(--tt-line);
    border-radius: 5px;
    background: #eaf1f6;
    overflow: hidden;
}
.topthink-staff .tt-attachment-preview:hover,
.topthink-staff .tt-attachment-preview:focus-visible {
    border-color: var(--tt-accent);
}
.topthink-staff .tt-attachment-preview img {
    display: block;
    width: 100%;
    height: 82px;
    object-fit: contain;
}
.topthink-staff .tt-attachment-file {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.topthink-staff .thread-body .tt-attachment-file .filename {
    min-width: 0;
    max-width: none;
}
.topthink-staff .tt-attachment-file .filesize {
    flex: none;
    white-space: nowrap;
    color: #52677a;
}
