:root {
  --orange: #ff6a00;
  --orange-dark: #d95200;
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --panel: #ffffff;
  --bg: #f6f7f8;
  --blue: #2563eb;
  --green: #059669;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}
a { color: var(--orange-dark); text-decoration: none; }

.auth-page { background: #fbfbfa; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 44%) 1fr;
}
.auth-brand {
  padding: 72px 56px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(255,245,238,.76)),
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.92), transparent 34%),
    linear-gradient(135deg, #ff7a1a 0%, #ff6a00 48%, #e95a00 100%);
  color: #281306;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 28px;
  pointer-events: none;
}
.auth-brand::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 330px;
  height: 330px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  pointer-events: none;
}
.brand-badge {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: white;
  color: white;
  font-weight: 800;
  box-shadow: 0 16px 36px rgba(255, 106, 0, .24);
  overflow: hidden;
}
.brand-badge.small { width: 42px; height: 42px; border-radius: 12px; font-size: 14px; }
.logo-badge img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.brand-logo-wide {
  width: min(420px, 100%);
  height: auto;
  display: block;
  border-radius: 18px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 20px 44px rgba(117, 45, 0, .18);
  position: relative;
  z-index: 1;
}
.auth-brand h1 { margin: 28px 0 10px; font-size: 38px; line-height: 1.15; }
.auth-brand p {
  color: rgba(40,19,6,.72);
  line-height: 1.8;
  max-width: 420px;
  margin-top: 24px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.brand-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.brand-pills span {
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.54);
  border-radius: 999px;
  color: #5d2600;
  background: rgba(255,255,255,.42);
  font-size: 13px;
  font-weight: 800;
  position: relative;
  z-index: 1;
}
.auth-card {
  width: min(440px, calc(100vw - 40px));
  margin: auto;
  padding: 28px;
}
.auth-card h2 { margin: 0 0 8px; font-size: 30px; }
.muted { color: var(--muted); }
form { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 8px; color: #344054; font-size: 14px; font-weight: 700; }
input,
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  font: inherit;
  background: white;
}
input:focus,
select:focus { outline: 3px solid rgba(255, 106, 0, .14); border-color: var(--orange); }
textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  line-height: 1.6;
  resize: vertical;
  background: white;
}
textarea:focus { outline: 3px solid rgba(255, 106, 0, .14); border-color: var(--orange); }
.primary-button {
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: white;
  font-weight: 800;
  cursor: pointer;
}
.primary-button:hover { background: var(--orange-dark); }
.primary-button:disabled { opacity: .72; cursor: wait; }
.form-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.form-error, .message {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}
.form-error, .message.error { color: #b42318; background: #fef3f2; }
.message.success { color: #027a48; background: #ecfdf3; }
.message.warning, .message.info { color: #92400e; background: #fffbeb; }

.app-topbar {
  height: 64px;
  padding: 0 28px;
  background: #15191f;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-brand { display: flex; align-items: center; gap: 12px; }
.app-brand strong { display: block; font-size: 18px; }
.app-brand span { display: block; color: rgba(255,255,255,.55); font-size: 12px; margin-top: 2px; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-topbar a,
.user-trigger {
  color: rgba(255,255,255,.74);
  font-weight: 800;
  font-size: 14px;
}
.topbar-link,
.logout-link,
.user-trigger {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-topbar a:hover,
.user-trigger:hover {
  color: white;
  background: rgba(255,255,255,.08);
}
.user-menu {
  position: relative;
}
.user-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  width: max(100%, 150px);
  height: 12px;
}
.user-trigger {
  border: 0;
  background: rgba(255,255,255,.06);
  cursor: pointer;
  font-family: inherit;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: none;
  min-width: 142px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(17, 24, 39, .16);
}
.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown {
  display: grid;
  gap: 4px;
}
.user-dropdown a {
  min-height: 38px;
  padding: 0 10px;
  justify-content: flex-start;
  color: var(--ink);
  border-radius: 8px;
}
.user-dropdown a:hover {
  color: var(--orange-dark);
  background: #fff7ed;
}
.logout-link {
  color: #ffd8bf !important;
}
.dashboard { max-width: 1080px; margin: 0 auto; padding: 48px 24px 80px; }
.dashboard-layout {
  max-width: 1180px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.dashboard-layout > .messages,
.account-layout > .messages,
.ticket-detail-page > .messages {
  grid-column: 1 / -1;
}
.workspace-sidebar {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 14px;
}
.workspace-content {
  min-width: 0;
}
.dashboard-hero { margin-bottom: 34px; }
.eyebrow { color: var(--orange-dark); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.dashboard-hero h1 { margin: 8px 0; font-size: 36px; }
.account-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.account-summary > div,
.panel-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, .04);
}
.account-summary > div {
  padding: 18px;
}
.account-summary span,
.info-list dt,
.subscription-row small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}
.account-summary strong {
  display: block;
  font-size: 17px;
}
.ok-text { color: var(--green); font-weight: 800; }
.danger-text { color: #b42318; font-weight: 800; }
.tool-list { display: grid; gap: 16px; }
.tool-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
}
.tool-card.active:hover { border-color: var(--orange); transform: translateY(-1px); }
.tool-card.disabled { opacity: .62; }
.tool-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff3eb;
  color: var(--orange-dark);
  font-weight: 900;
  flex: 0 0 auto;
}
.tool-mark.blue { color: var(--blue); background: #eff6ff; }
.tool-mark.green { color: var(--green); background: #ecfdf3; }
.tool-card h2 { margin: 0 0 5px; }
.tool-card p { margin: 0 0 8px; color: var(--muted); }
.tool-card small { color: var(--orange-dark); font-weight: 800; }
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.account-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.account-layout .message {
  grid-column: 1 / -1;
}
.account-sidebar {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 14px;
}
.sidebar-card,
.account-menu,
.account-content .panel-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, .04);
}
.sidebar-card {
  padding: 18px;
}
.sidebar-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 18px;
}
.sidebar-card span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.account-menu {
  display: grid;
  gap: 4px;
  padding: 8px;
}
.account-menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  color: #344054;
  border-radius: 10px;
  font-weight: 800;
}
.account-menu a:hover {
  color: var(--orange-dark);
  background: #fff7ed;
}
.account-menu a.active {
  color: white;
  background: var(--orange);
}
.menu-section {
  display: grid;
  gap: 4px;
}
.menu-parent::after {
  content: "展开";
  margin-left: auto;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 800;
}
.menu-parent.active::after {
  color: rgba(255,255,255,.78);
}
.submenu {
  display: grid;
  gap: 3px;
  padding: 4px 0 4px 12px;
  border-left: 2px solid #fed7aa;
  margin-left: 12px;
}
.submenu a {
  min-height: 36px;
  padding-left: 12px;
  color: #667085;
  font-size: 14px;
  background: transparent;
}
.submenu a:hover {
  color: var(--orange-dark);
  background: #fff7ed;
}
.submenu a.active {
  color: var(--orange-dark);
  background: #fff4eb;
}
.account-content {
  min-width: 0;
}
.compact-hero {
  margin: 0 0 18px;
  padding: 4px 2px 0;
}
.compact-hero h1 {
  font-size: 30px;
}
.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.profile-grid .dashboard-hero { margin-bottom: 4px; }
.full-row { grid-column: 1 / -1; }
.panel-card { padding: 22px; }
.panel-card h2 {
  margin: 0 0 16px;
  font-size: 20px;
}
.info-list {
  display: grid;
  gap: 13px;
  margin: 0;
}
.info-list div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
}
.info-list dt { margin: 0; }
.info-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}
.compact-note {
  margin: 14px 0 0;
  line-height: 1.7;
}
.subscription-list { display: grid; gap: 10px; }
.subscription-row,
.order-row,
.ticket-row {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid #f1f2f4;
}
.subscription-row {
  grid-template-columns: 1.35fr repeat(3, 1fr);
}
.order-list { display: grid; gap: 10px; }
.order-row {
  grid-template-columns: 1.35fr 1fr .75fr .75fr;
}
.membership-history-row,
.referral-reward-row {
  display: grid;
  grid-template-columns: 1fr .7fr .85fr 1.4fr .9fr;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid #f1f2f4;
}
.referral-reward-row {
  grid-template-columns: 1fr 1fr .7fr 1fr;
}
.membership-history-row strong,
.membership-history-row span,
.referral-reward-row strong,
.referral-reward-row span { display: block; }
.membership-history-row span,
.referral-reward-row span { color: var(--muted); font-size: 14px; }
.membership-history-row small,
.referral-reward-row small,
.referral-code-grid small,
.referral-stats small { display: block; margin-bottom: 7px; color: var(--muted); font-size: 13px; }
.referral-code-grid {
  display: grid;
  grid-template-columns: 140px minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
}
.referral-code-grid > div,
.referral-code-grid label { min-width: 0; }
.referral-code-grid > div { min-height: 46px; padding: 7px 12px; border: 1px solid #fed7aa; border-radius: 10px; background: #fff7ed; }
.referral-code-grid > div strong { color: var(--orange-dark); font-size: 18px; letter-spacing: .08em; }
.referral-code-grid label { gap: 7px; }
.referral-stats { margin: 18px 0; }
.referral-stats .panel-card { display: flex; align-items: baseline; gap: 8px; }
.referral-stats strong { color: var(--orange-dark); font-size: 28px; }
.subscription-row strong,
.order-row strong,
.ticket-row strong { display: block; }
.subscription-row span,
.order-row span,
.ticket-row span {
  color: var(--muted);
  font-size: 14px;
}
.order-row small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}
.ticket-form {
  margin-top: 0;
}
.two-fields {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
}
.three-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.fit-button {
  width: fit-content;
  min-width: 128px;
  padding: 0 20px;
}
.ticket-row {
  grid-template-columns: 1fr 90px;
}
.ticket-link {
  color: var(--ink);
  border-radius: 10px;
  padding-inline: 12px;
  transition: background-color 150ms ease, transform 150ms ease;
}
.ticket-link:hover {
  background: #fff7ed;
  transform: translateX(2px);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #475467;
  background: #f2f4f7;
  font-size: 13px;
  font-weight: 800;
}
.status-open { color: #92400e; background: #fffbeb; }
.status-processing { color: #1d4ed8; background: #eff6ff; }
.status-replied { color: #027a48; background: #ecfdf3; }
.status-closed { color: #475467; background: #f2f4f7; }
.ticket-detail-page .dashboard-hero {
  margin-bottom: 18px;
}
.ticket-detail-page .dashboard-hero p {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ticket-meta {
  margin-bottom: 16px;
}
.message-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  line-height: 1.8;
  background: #fbfbfa;
}
.admin-message {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.ticket-thread {
  display: grid;
  gap: 16px;
}
.thread-message {
  display: grid;
  gap: 8px;
  max-width: 82%;
}
.user-thread {
  justify-self: start;
}
.admin-thread {
  justify-self: end;
}
.thread-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.admin-thread .thread-meta {
  justify-content: flex-end;
}
.thread-meta strong {
  color: var(--ink);
}
.admin-thread .message-box {
  border-color: #fed7aa;
  background: #fff7ed;
}
.ticket-attachment {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(102, 112, 133, .28);
}
.ticket-attachment img {
  display: block;
  max-width: min(360px, 100%);
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.ticket-attachment a {
  width: fit-content;
  color: var(--orange-dark);
  font-weight: 800;
}
.ticket-reply-form {
  margin-top: 0;
}
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  font-weight: 800;
}
.secondary-button:hover {
  border-color: var(--orange);
  color: var(--orange-dark);
}
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.section-title-row h2 {
  margin-bottom: 0;
}
.compact-button {
  height: 36px;
  min-width: auto;
  padding: 0 14px;
  margin-top: 0;
  font-size: 13px;
}
.log-panel {
  margin-top: 28px;
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.log-panel h2 { margin: 0 0 14px; font-size: 18px; }
.log-row {
  display: grid;
  grid-template-columns: 1fr 1fr 150px;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f1f2f4;
  color: var(--muted);
  font-size: 14px;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.auth-links a {
  color: var(--orange-dark);
  font-weight: 800;
}
.inline-auth-form { margin-top: 10px; }
.auth-secondary { width: 100%; margin-top: 0; }
.announcement-panel {
  margin-bottom: 18px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, .04);
}
.announcement-list {
  display: grid;
  gap: 8px;
}
.compact-list {
  margin-top: 12px;
}
.announcement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fbfbfa;
  border: 1px solid #f0f1f2;
  border-radius: 10px;
}
.announcement-row:hover {
  border-color: #fed7aa;
  background: #fff7ed;
}
.announcement-row strong {
  display: block;
  margin-bottom: 5px;
}
.announcement-row span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.announcement-row small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.prose-card {
  padding: 28px;
}
.prose-card h1 {
  margin: 8px 0 10px;
  font-size: 30px;
}
.content-body {
  color: #26313b;
  line-height: 1.9;
}
.content-body p {
  margin: 0 0 14px;
}
.doc-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.doc-link-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, .04);
}
.doc-link-card:hover {
  border-color: #fed7aa;
  transform: translateY(-1px);
}
.doc-link-card strong {
  font-size: 18px;
}
.doc-link-card span {
  color: var(--muted);
  line-height: 1.65;
}
.public-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px 28px;
  background: #12171d;
  color: #fff;
}
.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 900;
}
.public-brand img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
}
.public-topbar nav {
  display: flex;
  gap: 12px;
}
.public-topbar nav a {
  color: #fff;
  font-weight: 800;
}
.content-page-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 44px 24px 80px;
}
.public-prose {
  background: #fff;
}

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 42px 24px; }
  .auth-brand h1 { font-size: 30px; }
  .auth-card { padding: 24px 20px 40px; }
  .app-topbar { height: auto; padding: 14px 18px; align-items: flex-start; gap: 14px; flex-direction: column; }
  .topbar-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .dashboard { padding: 28px 16px; }
  .dashboard-hero h1 { font-size: 28px; }
  .account-summary,
  .profile-grid,
  .dashboard-layout,
  .account-layout,
  .overview-grid,
  .doc-link-grid,
  .two-fields,
  .three-fields { grid-template-columns: 1fr; }
  .announcement-row { grid-template-columns: 1fr; }
  .public-topbar { align-items: flex-start; flex-direction: column; }
  .account-sidebar,
  .workspace-sidebar { position: static; }
  .account-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-card { align-items: flex-start; }
  .subscription-row,
  .order-row,
  .ticket-row,
  .membership-history-row,
  .referral-reward-row,
  .referral-code-grid { grid-template-columns: 1fr; }
  .thread-message {
    max-width: 100%;
  }
  .info-list div { grid-template-columns: 1fr; gap: 3px; }
  .log-row { grid-template-columns: 1fr; }
}
