/* ==========================================================================
   TangName System UI - 100% Matching Software Copyright Desktop Dashboard
   ========================================================================== */

:root {
  --bg-main: #0c121e;
  --bg-card: #131b2c;
  --bg-card-header: #19243b;
  --gold: #d4af37;
  --gold-light: #f5d77f;
  --gold-dark: #aa820a;
  --border-color: rgba(212, 175, 55, 0.22);
  --border-hover: rgba(212, 175, 55, 0.55);
  --text-main: #f0f4f8;
  --text-muted: #94a3b8;
}

body.system-body {
  margin: 0;
  padding: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: 'Outfit', 'Noto Serif SC', -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Background gradient effect */
.ink-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 20%, rgba(21, 35, 60, 0.7) 0%, rgba(12, 18, 30, 0.98) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Main Software Window Container */
.software-window {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* 1. OS Style Titlebar */
.window-titlebar {
  background: #090e17;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 40px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.titlebar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-icon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(135deg, #b22222, #8b0000);
  color: #f5d77f;
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.app-title-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}
.app-ver-tag {
  font-size: 0.68rem;
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
}
.titlebar-status-pill {
  font-size: 0.74rem;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.titlebar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.window-control-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.window-control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.window-control-btn.close-btn:hover {
  background: #dc2626;
  color: #fff;
}

/* 2. Software Function Navbar */
.system-navbar {
  background: #101726;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: visible;
  position: relative;
}
.nav-tabs-group {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}
.sys-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: 'Outfit', 'Noto Serif SC', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.sys-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.sys-tab-btn.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--border-hover);
  color: var(--gold-light);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.sys-tab-btn i {
  color: var(--gold);
  font-size: 0.9rem;
}

/* Language Selector */
.lang-selector-wrapper {
  position: relative;
}
.lang-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.lang-dropdown {
  position: fixed;
  top: 0;
  right: 16px;
  background: #131b2c;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  display: none;
  flex-direction: column;
  min-width: 160px;
  z-index: 9999;
  padding: 6px;
  max-height: 400px;
  overflow-y: auto;
}
.lang-selector-wrapper.open .lang-dropdown {
  display: flex;
}
.lang-option {
  padding: 8px 12px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.82rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.lang-option:hover, .lang-option.active {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
}

/* 3. System Viewport Workspace */
.system-workspace {
  flex: 1;
  padding: 20px;
  box-sizing: border-box;
}
.system-viewport {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}
.system-viewport.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Workbench 2-Column Split Grid */
.workbench-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 960px) {
  .workbench-split-grid {
    grid-template-columns: 1fr;
  }
}

/* Panel Card Container */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.panel-title {
  margin: 0;
  font-family: 'Cinzel', 'Noto Serif SC', serif;
  font-size: 1.05rem;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-badge {
  font-size: 0.72rem;
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

/* Form Controls & Inputs */
.config-form-group {
  margin-bottom: 18px;
}
.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}
.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  color: #0c121e;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.input-with-icon {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 0.9rem;
}
.sys-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  background: #090e17;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s;
}
.sys-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}
.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Toggle Buttons Group */
.btn-toggle-group {
  display: flex;
  gap: 8px;
}
.toggle-btn {
  flex: 1;
  padding: 8px 10px;
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.toggle-btn.active {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 600;
}

/* Category Tag Pills */
.category-tags-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.category-tag-pill {
  padding: 6px 4px;
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.category-tag-pill:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.category-tag-pill.active {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 600;
}

/* Generate Button */
.sys-btn-generate {
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #e5c058, #aa820a);
  border: none;
  border-radius: 8px;
  color: #0c121e;
  font-family: 'Cinzel', 'Noto Serif SC', serif;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
  transition: all 0.25s;
}
.sys-btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
  background: linear-gradient(135deg, #f5d77f, #c69500);
}

/* Right Result Card Preview */
.result-panel-card {
  position: relative;
  justify-content: space-between;
}
.header-actions {
  display: flex;
  gap: 6px;
}
.icon-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.icon-action-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold);
  color: var(--gold-light);
}

.name-display-box {
  background: #090e17;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  padding: 24px;
  position: relative;
  text-align: center;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.6);
}
.card-seal-stamp {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 2px solid #b22222;
  border-radius: 4px;
  color: #b22222;
  font-family: 'Noto Serif SC', serif;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  background: rgba(178, 34, 34, 0.05);
}
.card-chinese-name {
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-size: 3.2rem;
  color: var(--gold-light);
  letter-spacing: 6px;
  margin: 6px 0;
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}
.speaking-char {
  display: inline-block;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0 6px;
  border-radius: 8px;
  cursor: pointer;
}
.speaking-char:hover {
  color: #ffd700;
  transform: scale(1.08);
}
.speaking-char.active-speaking {
  color: #fffb8f !important;
  text-shadow: 0 0 25px rgba(255, 215, 0, 0.95), 0 0 45px rgba(212, 175, 55, 0.8), 0 0 60px rgba(255, 230, 100, 0.5) !important;
  transform: scale(1.28) translateY(-6px) !important;
  background: rgba(212, 175, 55, 0.25);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}
.card-pinyin {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  color: #94a3b8;
  margin-bottom: 16px;
}
.speaking-pinyin {
  display: inline-block;
  transition: all 0.22s ease;
  padding: 2px 8px;
  border-radius: 6px;
}
.speaking-pinyin.active-speaking {
  color: #ffd700 !important;
  font-weight: 700;
  background: rgba(212, 175, 55, 0.22);
  transform: scale(1.15);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.char-breakdown-section {
  text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.breakdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: #cbd5e1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.22s ease;
}
.breakdown-item.active-speaking {
  background: rgba(212, 175, 55, 0.16) !important;
  transform: translateX(6px);
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.25);
}
.breakdown-item.active-speaking .char-badge {
  background: rgba(212, 175, 55, 0.4) !important;
  border-color: var(--gold) !important;
  color: #ffd700 !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
  transform: scale(1.1);
}
.char-badge {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.22s ease;
}
#btnAudioPlay.speaking-pulse {
  background: rgba(212, 175, 55, 0.3) !important;
  border-color: var(--gold) !important;
  color: #ffd700 !important;
  animation: audioPlayPulse 0.9s infinite alternate;
}
@keyframes audioPlayPulse {
  0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.6); transform: scale(1); }
  100% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); transform: scale(1.06); }
}

.quote-source-section {
  text-align: left;
  background: rgba(212, 175, 55, 0.05);
  border-left: 3px solid var(--gold);
  padding: 12px 14px;
  border-radius: 0 6px 6px 0;
  margin-top: 8px;
}
.quote-title {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 4px;
}
.quote-text {
  font-family: 'Noto Serif SC', serif;
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 4px;
}
.quote-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.quote-vernacular {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.result-card-footer {
  display: flex;
  justify-content: space-around;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Full Viewport Panels (Corpus, Surnames, Checkout) */
.full-viewport-panel {
  min-height: 520px;
}
.corpus-toolbar, .surnames-toolbar {
  margin-bottom: 16px;
}
.corpus-book-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.book-filter-btn {
  padding: 4px 10px;
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 14px;
  font-size: 0.78rem;
  cursor: pointer;
}
.book-filter-btn.active {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 600;
}

.corpus-table-scroll {
  overflow-x: auto;
  max-height: 480px;
}
.sys-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.sys-data-table th {
  background: #090e17;
  color: var(--gold-light);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.sys-data-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}
.sys-data-table tr:hover {
  background: rgba(212, 175, 55, 0.04);
}

/* Surnames Grid & Alphabet Bar */
.az-alphabet-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.az-letter {
  padding: 2px 8px;
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}
.az-letter.active {
  background: var(--gold);
  color: #0c121e;
  font-weight: 700;
}
.surnames-display-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  margin-top: 16px;
}
.surname-item-card {
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.surname-item-card:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  transform: translateY(-2px);
}
.surname-item-char {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold-light);
}
.surname-item-pinyin {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* I18n Flag Grid */
.i18n-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 10px 0;
}
.i18n-lang-card {
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.i18n-lang-card:hover, .i18n-lang-card.active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
}
.i18n-flag {
  font-size: 2rem;
}
.i18n-title {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
}
.i18n-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Pricing Grid */
.pricing-tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 20px 0;
}
@media (max-width: 900px) {
  .pricing-tiers-grid {
    grid-template-columns: 1fr;
  }
}
.tier-card {
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tier-card.popular {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.06);
}
.tier-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.popular-tag {
  background: var(--gold);
  color: #0c121e;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  display: inline-block;
}
.tier-name {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: #fff;
}
.tier-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 16px;
}
.cny-tag {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}
.tier-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.8;
}
.tier-features li i {
  color: var(--gold);
  margin-right: 6px;
}
.tier-btn {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
.tier-btn.gold-btn {
  background: linear-gradient(135deg, #d4af37, #aa820a);
  color: #0c121e;
  border: none;
}
.payment-channels-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.85rem;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Certificate Modal - Imperial Obsidian Gold Theme (Matches Homepage) */
.cert-preview-container {
  background: linear-gradient(155deg, #0b1329 0%, #060a14 100%);
  color: #f1f5f9;
  border-radius: 12px;
  padding: 32px 24px 26px;
  max-width: 400px;
  margin: 0 auto;
  border: 2px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), inset 0 0 35px rgba(212, 175, 55, 0.06);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cert-watermark-grid {
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-content: space-around;
  justify-content: space-around;
  z-index: 10;
  opacity: 0.16;
}
.cert-watermark-item {
  transform: rotate(-28deg);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #d4af37;
  letter-spacing: 2px;
  user-select: none;
  margin: 18px 24px;
  text-transform: lowercase;
}
.cert-header-title {
  font-family: 'Cinzel', 'Noto Serif SC', serif;
  font-size: 1.15rem;
  color: #fef08a;
  letter-spacing: 4px;
  margin-bottom: 14px;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}
.cert-name-char {
  font-family: 'Ma Shan Zheng', serif;
  font-size: 3.4rem;
  color: #fef08a;
  letter-spacing: 8px;
  margin: 10px 0 6px;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.6), 0 0 35px rgba(212, 175, 55, 0.25);
}
.cert-pinyin {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  color: #cbd5e1;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.cert-seal {
  width: 52px;
  height: 52px;
  border: 2px solid #ef4444;
  border-radius: 4px;
  background: rgba(185, 28, 28, 0.22);
  color: #f87171;
  font-family: 'Noto Serif SC', serif;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px auto;
  line-height: 1.15;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
}
.cert-quote-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-left: 3px solid #d4af37;
  border-radius: 4px;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.82rem;
  color: #e2e8f0;
  margin: 16px 0;
  line-height: 1.6;
}
.cert-date-text {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 14px;
  letter-spacing: 0.6px;
}
.cert-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ── Missing Classes Fix ──────────────────────────────────────────────── */

/* Titlebar center status area */
.titlebar-center {
  flex: 1;
  text-align: center;
}

/* Language name in selector */
.lang-name {
  font-size: 0.82rem;
}

/* Config panel card (left workbench) */
.config-panel-card {
  overflow-y: auto;
  max-height: calc(100vh - 160px);
}

/* Surname config row */
.surname-config-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Surname search wrapper - hidden by default */
.surname-search-wrapper {
  display: none;
  position: relative;
}

/* Surname autocomplete suggestions dropdown */
.surname-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #131b2c;
  border: 1px solid var(--border-color);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
}
.surname-suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.88rem;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.surname-suggestion-item:hover {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
}

/* Corpus search input wrapper */
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-wrap i {
  position: absolute;
  left: 12px;
  color: var(--gold);
  font-size: 0.9rem;
  pointer-events: none;
}
.search-input-wrap .sys-input {
  padding-left: 36px;
}

/* Corpus "Use Quote" button */
.btn-use-quote {
  padding: 4px 10px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.btn-use-quote:hover {
  background: rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

/* ── Modal System (Certificate + Paywall) ─────────────────────────────── */
.system-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.system-modal-backdrop.active {
  display: flex;
}
.system-modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.25s ease-out;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.system-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.system-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.system-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.system-modal-close:hover {
  color: #ef4444;
}
.system-modal-body {
  padding: 20px;
}

.social-share-btn {
  transition: all 0.22s ease;
  user-select: none;
}
.social-share-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
.social-share-btn:active {
  transform: translateY(0);
}

/* ── Responsive Fixes ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .window-titlebar { padding: 0 8px; }
  .titlebar-center { display: none; }
  .system-navbar { flex-wrap: wrap; padding: 6px 8px; }
  .nav-tabs-group { gap: 3px; }
  .sys-tab-btn { padding: 6px 8px; font-size: 0.78rem; }
  .sys-tab-btn span { display: none; }
  .system-workspace { padding: 10px; }
  .workbench-split-grid { grid-template-columns: 1fr; }
  .category-tags-grid { grid-template-columns: repeat(3, 1fr); }
  .corpus-table-scroll { max-height: 360px; }
  .surnames-display-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .lang-selector-wrapper { order: -1; }
}
