@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Spectral:wght@400;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #f3ead7;
  --panel: #fff7ea;
  --ink: #2b1d0e;
  --accent: #b95412;
  --accent-soft: #efd5b4;
  --shadow: rgba(42, 26, 10, 0.18);
  --font-display: "Cinzel", "Garamond", "Times New Roman", serif;
  --font-body: "Spectral", "Georgia", serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
}

/* 暗黑模式变量 */
:root.dark {
  --bg: #1a1614;
  --panel: #25201c;
  --ink: #e8e0d4;
  --accent: #e8a058;
  --accent-soft: #4a3828;
  --shadow: rgba(0, 0, 0, 0.4);
}

body.dark {
  background:
    radial-gradient(circle at top, #2a2420 0%, #1e1a16 45%, #161210 100%),
    repeating-linear-gradient(120deg, rgba(0, 0, 0, 0.03) 0 10px, rgba(0, 0, 0, 0.08) 10px 20px);
}

body.dark::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(232, 160, 88, 0.08), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(144, 90, 40, 0.08), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(232, 190, 140, 0.06), transparent 55%);
}

body.dark::after {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.01) 0 16px, rgba(0, 0, 0, 0.05) 16px 32px),
    radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.2) 46%, rgba(0, 0, 0, 0.2) 47%, transparent 48%);
}

body.dark header p {
  color: #9a8a7a;
}

body.dark .auth-copy {
  background: linear-gradient(135deg, rgba(52, 44, 36, 0.9), rgba(38, 30, 24, 0.9));
  border-color: #4a3a30;
}

body.dark .auth-copy h2 {
  color: #e8e0d4;
}

body.dark .auth-copy p {
  color: #b8a898;
}

body.dark .badge {
  background: rgba(232, 160, 88, 0.18);
  color: #d8a068;
}

body.dark .auth-card {
  background: #2a2420;
  border-color: #4a3a30;
}

body.dark input,
body.dark select {
  background: #2a2420;
  border-color: #4a3a30;
  color: var(--ink);
}

body.dark select option {
  background: #2a2420;
  color: var(--ink);
}

body.dark button {
  box-shadow: 0 6px 14px rgba(232, 160, 88, 0.3);
}

body.dark .toast {
  background: #0d0b08;
  color: #e8e0d4;
}

body.dark .char-card {
  background: #2a2420;
  border-color: #4a3a30;
}

body.dark .status-card {
  background: #2a2420;
  border-color: #4a3a30;
  box-shadow: inset 0 0 0 1px rgba(232, 160, 88, 0.15);
}

body.dark .bar {
  background: #3a3028;
}

body.dark .bar-label {
  color: #a89888;
}

body.dark .quick-btn {
  background: #4a3828;
  color: #e8e0d4;
  border-color: #5a4838;
}

body.dark .chat-wrap {
  background: #2a2420;
  border-color: #4a3a30;
  box-shadow: inset 0 0 0 1px rgba(232, 160, 88, 0.15);
}

body.dark .chat-header {
  background: linear-gradient(90deg, #3a3028 0%, #2a2420 100%);
  color: #c8b8a8;
}

body.dark .chat-log {
  background: #25201c;
  border-color: #4a3a30;
}

body.dark #chat-input {
  background: #2a2420;
  color: var(--ink);
}

body.dark .chat-emoji-btn {
  background: #3a3028;
  color: #c8b8a8;
  border-color: #4a3828;
}

body.dark .emoji-panel {
  background: #2a2420;
  border-color: #4a3828;
}

body.dark .emoji-btn {
  background: #4a3828;
}

body.dark .chat-btn,
body.dark .chat-link-btn {
  background: #4a3828;
  color: #e8e0d4;
  border-color: #5a4838;
}

body.dark .chat-name-btn {
  color: #c8a068;
}

body.dark .chat-name-btn:hover {
  color: #e8b078;
}

body.dark .chat-tag {
  color: #c88048;
}

body.dark .chat-link-tag {
  border-color: rgba(232, 160, 88, 0.4);
  background: #a86028;
  color: #fff7ea;
}

body.dark .modal {
  background: rgba(10, 8, 6, 0.65);
}

body.dark .modal-card {
  background: #25201c;
  border-color: #4a3a30;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

body.dark #shop-modal .modal-actions,
body.dark #consign-modal .modal-actions,
body.dark #bag-modal .modal-actions,
body.dark #drops-modal .modal-actions {
  background: #25201c;
  border-color: #4a3a30;
}

body.dark .modal-text {
  color: #b8a898;
}

body.dark .modal-card .modal-title {
  color: #e8e0d4;
}

body.dark #prompt-input {
  background: #2a2420;
  border-color: #4a3a30;
  color: var(--ink);
}

body.dark #trade-item,
body.dark #trade-qty,
body.dark #trade-gold {
  background: #2a2420;
  border-color: #4a3a30;
  color: var(--ink);
}

body.dark #trade-item option {
  background: #2a2420;
  color: var(--ink);
}

body.dark .trade-status {
  color: #a89888;
}

body.dark #bag-page {
  color: #a89888;
}

body.dark #consign-market-page,
body.dark #consign-my-page,
body.dark #consign-inventory-page,
body.dark #consign-history-page {
  color: #a89888;
}

body.dark #shop-subtitle,
body.dark #guild-title,
body.dark #party-title {
  color: #a89888;
}

body.dark #prompt-extra,
body.dark .quick-btn {
  background: #4a3828;
  color: #e8e0d4;
  border-color: #5a4838;
}

body.dark .shop-item,
body.dark .shop-sell-item,
body.dark .consign-item,
body.dark .bag-item,
body.dark .repair-item,
body.dark .afk-skill-item {
  background: #3a3028;
  border-color: #5a4838;
  color: #e8e0d4;
}

body.dark .afk-skill-item.selected {
  background: #c86b2a;
  color: #fff7ea;
  border-color: #a8551a;
}

body.dark .consign-tab,
body.dark .consign-filter,
body.dark .bag-tab,
body.dark .drops-tab {
  background: #3a3028;
  border-color: #5a4838;
  color: #c8b8a8;
}

body.dark .consign-tab.active,
body.dark .consign-filter.active,
body.dark .bag-tab.active,
body.dark .drops-tab.active {
  background: #c86b2a;
  color: #fff7ea;
  border-color: #a8551a;
}

body.dark .consign-item small {
  color: #8a7a6a;
}

body.dark .consign-history-item {
  background: #3a3028;
  border-color: #5a4838;
  color: #e8e0d4;
}

body.dark .consignment-history-meta {
  color: #8a7a6a;
}

body.dark .drops-item {
  background: #2a2420;
  border-color: #4a3828;
}

body.dark .drops-item-name {
  color: #c8b8a8;
}

body.dark .drops-item-mobs {
  color: #a89888;
}

body.dark .drops-drop {
  background: #3a3028;
  border-color: #4a3828;
}

body.dark .rank-item {
  background: #3a3028;
  border-color: #4a3828;
}

body.dark .rank-item .rank-pos {
  color: #c88048;
}

body.dark .guild-member {
  background: #3a3028;
  border-color: #4a3828;
}

body.dark .guild-member .tag {
  background: #c86b2a;
  color: #fff7ea;
}

body.dark .summon-details {
  background: #2a2420;
  border-color: #4a3828;
}

body.dark .summon-name {
  color: #c8b8a8;
}

body.dark .summon-level {
  color: #a89888;
}

body.dark .summon-bar-label {
  color: #a89888;
}

body.dark .summon-bar {
  background: #3a3028;
}

body.dark .summon-stats {
  color: #a89888;
  border-color: #4a3828;
}

body.dark .summon-stat {
  background: rgba(52, 44, 36, 0.5);
}

body.dark .summon-stat-label {
  color: #8a7a6a;
}

body.dark .summon-stat-value {
  color: #c8b8a8;
}

/* 暗黑模式 - 观察弹窗 */
body.dark .observe-content {
  background: rgba(32, 28, 24, 0.95);
}

body.dark .observe-section-title {
  color: #e8a058;
  border-bottom-color: rgba(232, 160, 88, 0.3);
}

body.dark .observe-stat-label {
  color: #c8b8a8;
}

body.dark .observe-stat-value {
  color: #e8a058;
}

body.dark .observe-equipment-item,
body.dark .observe-summon-item {
  background: rgba(74, 58, 40, 0.6);
}

body.dark .observe-equipment-name,
body.dark .observe-summon-name {
  color: #e8e0d4;
}

body.dark .observe-equipment-durability,
body.dark .observe-summon-stats {
  color: #c8b8a8;
}

body.dark .item-tooltip {
  background: rgba(20, 16, 12, 0.96);
  border-color: rgba(180, 140, 100, 0.5);
  color: #e8e0d4;
}

body.dark .side {
  background: #2a2420;
  border-color: #4a3a30;
  box-shadow: inset 0 0 0 1px rgba(232, 160, 88, 0.15);
}

body.dark .action-title {
  color: #c8b8a8;
}

body.dark .chip {
  background: #3a3028;
  border-color: #5a4838;
  color: #e8e0d4;
}

body.dark .chip.active {
  background: #c86b2a;
  color: #fff7ea;
  border-color: #a8551a;
}

body.dark .chip.player-friendly {
  background: #2a3038;
  border-color: #3a5070;
  color: #6a9aca;
}

body.dark .chip.player-enemy {
  background: #382a2a;
  border-color: #704040;
  color: #ca6a6a;
}

body.dark .target-label {
  background: #2a2420;
  border-color: #4a3828;
}

body.dark .line-prefix {
  background: rgba(72, 48, 24, 0.85);
  color: #e8e0d4;
}

body.dark .chat-log .line-text {
  color: #e8e0d4;
}

body.dark .log .line-text {
  color: #f7f1e5;
}

body.dark .shop-sell-tip,
body.dark .modal-text {
  color: #a89888;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, #fff7ea 0%, #f1e1c9 45%, #e3c6a4 100%),
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.05) 0 10px, rgba(0, 0, 0, 0.02) 10px 20px);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(185, 84, 18, 0.12), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(90, 55, 20, 0.12), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(185, 120, 70, 0.1), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0 16px, rgba(0, 0, 0, 0.02) 16px 32px),
    radial-gradient(circle at center, transparent 45%, rgba(40, 24, 10, 0.08) 46%, rgba(40, 24, 10, 0.08) 47%, transparent 48%);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

#app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  position: relative;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

.header-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  background: var(--accent-soft);
  color: var(--ink);
  border: 1px solid rgba(118, 70, 22, 0.25);
  box-shadow: inset 0 0 0 1px rgba(118, 70, 22, 0.25);
  padding: 8px 12px;
  font-size: 1.2rem;
  min-width: auto;
}

header h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  letter-spacing: 1px;
  margin: 0 0 8px;
}

header p {
  margin: 0;
  color: #5a3a1a;
}

.panel {
  background: var(--panel);
  border: 1px solid #e7caa6;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 12px 30px var(--shadow);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.hidden {
  display: none;
}

#auth {
  padding: 26px;
}

.auth-hero {
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.auth-copy {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 248, 237, 0.9), rgba(244, 226, 198, 0.9));
  border: 1px solid #e7caa6;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 190, 0.45);
}

.auth-copy h2 {
  margin: 12px 0 8px;
  font-family: var(--font-display);
  font-size: 1.8rem;
}

.auth-copy p {
  margin: 0 0 16px;
  color: #563720;
}

.auth-ornament {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #c78b51, transparent);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(185, 84, 18, 0.18);
  color: #6a3a1a;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-cards {
  display: grid;
  gap: 12px;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  background: #fffdf7;
  border: 1px solid #f0dcc2;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 190, 0.35);
}

.auth-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.captcha-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.captcha-row input {
  flex: 1;
  min-width: 0;
}

.captcha-img {
  width: 120px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #e0c2a0;
  background: #fff3e1;
  cursor: pointer;
}

.captcha-refresh {
  padding: 8px 10px;
  font-size: 0.9rem;
  background: #f0c79e;
  color: #3b2412;
  box-shadow: inset 0 0 0 1px rgba(118, 70, 22, 0.25);
}

input, select {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d9b894;
  background: #fffaf1;
}

button {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fffaf1;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(214, 109, 26, 0.3);
}

button:hover {
  filter: brightness(1.05);
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.btn-loading::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  border: 2px solid rgba(255, 245, 230, 0.5);
  border-top-color: #fff5e6;
  animation: spin 0.8s linear infinite;
}

.shake {
  animation: shake 0.45s ease;
}

@keyframes spin {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.msg {
  margin-top: 12px;
  color: #8d3f12;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2d1a0f;
  color: #f7e6d3;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(18, 10, 4, 0.45);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 5;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

#character-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.char-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fffdf7;
  border: 1px solid #f0dcc2;
  min-width: 180px;
}

.divider {
  margin: 18px 0;
  height: 1px;
  background: #e7caa6;
}

.game-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 18px;
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.status-card {
  background: #fffdf7;
  border-radius: 14px;
  border: 1px solid #f0dcc2;
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 190, 0.35);
}

.status-title {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 10px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
}

.status-row.compact {
  margin: 2px 0;
  gap: 6px;
}

.status-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.status-grid-3 .status-row {
  margin: 2px 0;
  font-size: 0.88rem;
}

.status-grid-3 .status-row.wide {
  grid-column: span 3;
  justify-content: flex-start;
  gap: 10px;
  align-items: center;
}

.status-grid-3 .status-row.wide span,
.status-grid-3 .status-row.wide strong {
  white-space: nowrap;
}

.status-grid-3 .status-row.wide span::after {
  content: '';
}

.status-row strong {
  font-weight: 600;
}

.bar-label {
  font-size: 0.9rem;
  color: #6b4a2a;
  margin: 6px 0 4px;
}

.bar {
  height: 10px;
  background: #e8d4b9;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(66, 44, 20, 0.1);
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.bar-fill.hp { background: linear-gradient(90deg, #8b1f1f, #d05a2f); }
.bar-fill.mp { background: linear-gradient(90deg, #1b4d8b, #2e8bd0); }
.bar-fill.exp { background: linear-gradient(90deg, #1f6b3b, #35b36c); }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-btn {
  background: #f0c79e;
  color: #3b2412;
  box-shadow: inset 0 0 0 1px rgba(118, 70, 22, 0.25);
  padding: 8px 10px;
}

.log-wrap {
  display: flex;
  flex-direction: column;
  background: #1a120b;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 210, 150, 0.2), 0 10px 20px rgba(13, 10, 6, 0.45);
  overflow: hidden;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(90deg, #2c1a0f 0%, #1b1008 100%);
  color: #f7e9d6;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.log-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-filter {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.log-filter input {
  cursor: pointer;
}

.log-filter span {
  color: #f7e9d6;
}

.log-toggle {
  background: rgba(255, 255, 255, 0.15);
  color: #f7e9d6;
  border: 1px solid rgba(255, 210, 150, 0.3);
  padding: 4px 8px;
  font-size: 0.9rem;
  min-width: auto;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.log-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.log-wrap.collapsed .log {
  display: none;
}

.log-wrap.collapsed {
  min-height: auto;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(217, 108, 26, 0.25);
  color: #f5d7b8;
  font-size: 0.75rem;
}

.log {
  background: #0d0b08;
  color: #f7f1e5;
  padding: 16px;
  min-height: 360px;
  max-height: 420px;
  overflow-y: auto;
  font-family: var(--font-mono);
}

.chat-wrap {
  background: #fffdf7;
  border-radius: 16px;
  border: 1px solid #f0dcc2;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 190, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(90deg, #f3e1c7 0%, #e9cfaa 100%);
  color: #5b3a1c;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.4px;
}

.chat-log {
  padding: 12px 14px;
  min-height: 160px;
  max-height: 220px;
  overflow-y: auto;
  background: #fff8ee;
  border-top: 1px solid #ead0ad;
  border-bottom: 1px solid #ead0ad;
  font-family: var(--font-mono);
}

.chat-log p {
  margin: 0 0 8px;
  white-space: pre-wrap;
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 4px;
}

.chat-btn {
  background: #f0c79e;
  color: #3b2412;
  box-shadow: inset 0 0 0 1px rgba(118, 70, 22, 0.25);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 8px 14px 12px;
  align-items: center;
}

.chat-link-btn {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f0c79e;
  color: #3b2412;
  font-size: 0.75rem;
  cursor: pointer;
}

.chat-link-btn:hover {
  filter: brightness(1.05);
}

.chat-name-btn {
  border: none;
  background: transparent;
  color: #7a4a1f;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.chat-name-btn:hover {
  color: #9b5a26;
  text-decoration: underline;
}

.chat-tag {
  color: #a25d28;
  font-weight: 600;
}

.chat-link-tag {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 160, 0.4);
  background: #b85c1b;
  color: #fff2d8;
  font-size: 0.75rem;
  cursor: pointer;
}

.chat-link-tag:hover {
  filter: brightness(1.05);
}

#chat-input {
  flex: 1;
  font-family: var(--font-mono);
  background: #fffaf1;
}

.chat-emoji-btn {
  padding: 6px 10px;
  font-size: 1rem;
  line-height: 1;
  background: #f6e1c6;
  color: #5b3a1c;
  box-shadow: inset 0 0 0 1px rgba(118, 70, 22, 0.2);
}

.emoji-panel {
  margin: 0 14px 12px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(118, 70, 22, 0.2);
  background: #fff7ea;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.emoji-panel.hidden {
  display: none;
}

.emoji-btn {
  border: none;
  background: #f2d6b6;
  border-radius: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 1rem;
}

.emoji-btn:hover {
  filter: brightness(1.05);
}

.trade-panel {
  padding: 0;
  border-top: none;
  background: transparent;
}

.trade-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.trade-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

#trade-item {
  flex: 1;
  min-width: 0;
  background: #fffaf1;
  color: #2b1d0e;
}

#trade-item option {
  background: #fffaf1;
  color: #2b1d0e;
}

#trade-qty,
#trade-gold {
  width: 90px;
}

.trade-status {
  font-size: 0.85rem;
  color: #6b4a2a;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(32, 20, 10, 0.45);
  z-index: 10;
}

#prompt-modal {
  z-index: 40;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(420px, 90vw);
  background: #fff7ea;
  border-radius: 16px;
  border: 1px solid #e7caa6;
  padding: 16px;
  box-shadow: 0 18px 40px rgba(20, 12, 6, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.modal-text {
  font-size: 0.9rem;
  color: #5b3a1c;
  white-space: pre-wrap;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-actions button {
  min-width: 90px;
}

#player-modal .modal-actions {
  justify-content: center;
  gap: 8px;
}

#player-modal .modal-actions button {
  min-width: 70px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

#prompt-extra {
  background: #f0c79e;
  color: #3b2412;
  box-shadow: inset 0 0 0 1px rgba(118, 70, 22, 0.25);
}

#shop-modal .modal-card {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

#shop-modal .modal-list-wrapper {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 10px;
}

#shop-modal .modal-actions {
  position: sticky;
  bottom: 0;
  background: #fff5e8;
  padding: 12px 10px;
  border-top: 1px solid rgba(118, 70, 22, 0.15);
  flex-shrink: 0;
  z-index: 10;
}

/* 手机设备优化 */
@media (max-width: 820px) {
  .auth-hero {
    grid-template-columns: 1fr;
  }
  .status-grid {
    grid-template-columns: 1fr;
  }
  .game-grid {
    grid-template-columns: 1fr;
  }
  header h1 {
    font-size: 2.1rem;
  }
  .log {
    min-height: 300px;
  }
}

@media (max-width: 640px) {
  #app {
    padding: 16px 8px 24px;
  }

  header {
    margin-bottom: 16px;
  }

  header h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
  }

  header p {
    font-size: 0.9rem;
  }

  .panel {
    padding: 16px;
    border-radius: 12px;
  }

  .status-card {
    padding: 12px;
  }

  .status-row {
    font-size: 0.85rem;
  }

  .status-row span {
    min-width: 60px;
  }

  .bar {
    height: 8px;
  }

  .bar-label {
    font-size: 0.8rem;
    margin: 4px 0 2px;
  }

  .log-wrap {
    border-radius: 12px;
  }

  .log-header {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .log {
    padding: 12px;
    min-height: 250px;
    max-height: 350px;
    font-size: 0.85rem;
  }

  .chat-wrap {
    border-radius: 12px;
  }

  .chat-header {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .chat-log {
    padding: 10px 12px;
    min-height: 140px;
    max-height: 200px;
    font-size: 0.85rem;
  }

  .chat-actions {
    gap: 6px;
    padding: 8px 12px 4px;
  }

  .chat-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .chat-input-row {
    padding: 8px 12px 10px;
  }

  .chat-input-row input {
    flex: 1;
    min-width: 0;
  }

  .action-group {
    margin-bottom: 12px;
  }

  .action-title {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .chip {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .chip-grid {
    gap: 6px;
  }

  .modal-card {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: 85vh;
    border-radius: 12px;
    padding: 16px 12px;
    margin: 0 8px;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .modal-text {
    font-size: 0.9rem;
  }

  .modal-actions {
    gap: 8px;
    flex-wrap: wrap;
  }

  .modal-actions button {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 10px;
    font-size: 0.9rem;
  }

  .bag-item {
    padding: 8px;
    font-size: 0.85rem;
  }

  .bag-item-name {
    font-size: 0.9rem;
  }

  .bag-item-meta {
    font-size: 0.75rem;
  }

  #trade-item,
  #trade-qty,
  #trade-gold {
    padding: 8px;
    font-size: 0.9rem;
  }

  .trade-panel {
    gap: 12px;
  }

  .trade-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .afk-skill-list {
    gap: 8px;
  }

  .afk-skill-item {
    padding: 8px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  #app {
    padding: 12px 4px 20px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .panel {
    padding: 12px 8px;
  }

  .status-grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .status-row {
    font-size: 0.8rem;
  }

  .status-row span {
    min-width: 50px;
  }

  .log {
    min-height: 200px;
    max-height: 300px;
    font-size: 0.8rem;
  }

  .chat-log {
    min-height: 120px;
    max-height: 180px;
    font-size: 0.8rem;
  }

  .chat-btn {
    padding: 4px 6px;
    font-size: 0.7rem;
  }

  .chat-actions {
    gap: 4px;
  }

  .chip {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .modal-card {
    width: calc(100vw - 8px);
    max-width: none;
    max-height: 85vh;
    border-radius: 12px;
    padding: 12px 8px;
    margin: 0 4px;
  }

  .modal-actions button {
    min-width: 100%;
  }

  .item-tooltip {
    max-width: 200px;
    font-size: 0.85rem;
  }

  .guild-member {
    font-size: 0.85rem;
  }

  .guild-member button {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .summon-details {
    padding: 8px;
  }

  .summon-name {
    font-size: 0.85rem;
  }

  .summon-level {
    font-size: 0.8rem;
  }

  .summon-bar-label {
    width: 36px;
    font-size: 0.75rem;
  }

  .summon-bar {
    height: 6px;
  }

  .summon-stats {
    font-size: 0.75rem;
  }

  .summon-stat {
    padding: 4px;
  }

  .summon-stat-label {
    font-size: 0.65rem;
  }

  .summon-stat-value {
    font-size: 0.8rem;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .chip:hover {
    transform: none;
  }
  
  .chat-btn:hover {
    filter: none;
  }
  
  button:active {
    transform: scale(0.98);
  }
  
  input, select, button {
    min-height: 44px;
  }
  
  .chat-input-row input,
  .trade-row input,
  .trade-row select,
  .trade-row button,
  .modal-actions button {
    min-height: 44px;
  }
}


.shop-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shop-item {
  border-radius: 12px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  padding: 10px 12px;
  text-align: center;
  cursor: pointer;
  line-height: 1.3;
}

.shop-item:hover {
  filter: brightness(1.03);
}

.shop-sell-title {
  margin-top: 8px;
  font-weight: 600;
}

.shop-sell-tip {
  font-size: 0.82rem;
  color: #6b4a2a;
}

.shop-sell-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.shop-sell-item {
  border-radius: 999px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  padding: 6px 10px;
  font-size: 0.85rem;
  text-align: center;
  cursor: pointer;
  line-height: 1.2;
}

.shop-sell-item:hover {
  filter: brightness(1.03);
}

.consign-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.consign-tabs {
  display: flex;
  gap: 8px;
  margin: 6px 0 10px;
}

.consign-tab {
  border-radius: 999px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f5d8b4;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #3a2311;
  cursor: pointer;
}

.consign-tab.active {
  background: #d07a2c;
  color: #fff;
}

.consign-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.consign-filter {
  border-radius: 999px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: #3a2311;
  cursor: pointer;
}

.consign-filter.active {
  background: #d07a2c;
  color: #fff;
}

.consign-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 2px;
  font-size: 0.85rem;
}

.consign-pager button {
  min-width: 84px;
}

.consign-panel.hidden {
  display: none;
}

.consign-item {
  border-radius: 12px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.3;
}

.consign-item:hover {
  filter: brightness(1.03);
}

.consign-item small {
  display: block;
  color: #6b4a2a;
  margin-top: 4px;
}

.consign-history-item {
  border-radius: 12px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.consign-history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-weight: 600;
}

.conign-history-item-item {
  color: #3a2311;
}

.consignment-history-meta {
  color: #6b4a2a;
  font-size: 0.8rem;
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

#consign-modal .modal-card {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

#consign-modal .modal-list-wrapper {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 10px;
}

#consign-modal .modal-actions {
  position: sticky;
  bottom: 0;
  background: #fff5e8;
  padding: 12px 10px;
  border-top: 1px solid rgba(118, 70, 22, 0.15);
  flex-shrink: 0;
  z-index: 10;
}

/* 手机设备优化 */
@media (max-width: 820px) {
  .auth-hero {
    grid-template-columns: 1fr;
  }
  .status-grid {
    grid-template-columns: 1fr;
  }
  .game-grid {
    grid-template-columns: 1fr;
  }
  header h1 {
    font-size: 2.1rem;
  }
  .log {
    min-height: 300px;
  }
}

@media (max-width: 640px) {
  #app {
    padding: 16px 8px 24px;
  }

  header {
    margin-bottom: 16px;
  }

  header h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
  }

  header p {
    font-size: 0.9rem;
  }

  .panel {
    padding: 16px;
    border-radius: 12px;
  }

  .status-card {
    padding: 12px;
  }

  .status-row {
    font-size: 0.85rem;
  }

  .status-row span {
    min-width: 60px;
  }

  .bar {
    height: 8px;
  }

  .bar-label {
    font-size: 0.8rem;
    margin: 4px 0 2px;
  }

  .log-wrap {
    border-radius: 12px;
  }

  .log-header {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .log {
    padding: 12px;
    min-height: 250px;
    max-height: 350px;
    font-size: 0.85rem;
  }

  .chat-wrap {
    border-radius: 12px;
  }

  .chat-header {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .chat-log {
    padding: 10px 12px;
    min-height: 140px;
    max-height: 200px;
    font-size: 0.85rem;
  }

  .chat-actions {
    gap: 6px;
    padding: 8px 12px 4px;
  }

  .chat-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .chat-input-row {
    padding: 8px 12px 10px;
  }

  .chat-input-row input {
    flex: 1;
    min-width: 0;
  }

  .action-group {
    margin-bottom: 12px;
  }

  .action-title {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .chip {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .chip-grid {
    gap: 6px;
  }

  .modal-card {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: 85vh;
    border-radius: 12px;
    padding: 16px 12px;
    margin: 0 8px;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .modal-text {
    font-size: 0.9rem;
  }

  .modal-actions {
    gap: 8px;
    flex-wrap: wrap;
  }

  .modal-actions button {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 10px;
    font-size: 0.9rem;
  }

  .bag-item {
    padding: 8px;
    font-size: 0.85rem;
  }

  .bag-item-name {
    font-size: 0.9rem;
  }

  .bag-item-meta {
    font-size: 0.75rem;
  }

  #trade-item,
  #trade-qty,
  #trade-gold {
    padding: 8px;
    font-size: 0.9rem;
  }

  .trade-panel {
    gap: 12px;
  }

  .trade-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .afk-skill-list {
    gap: 8px;
  }

  .afk-skill-item {
    padding: 8px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  #app {
    padding: 12px 4px 20px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .panel {
    padding: 12px 8px;
  }

  .status-grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .status-row {
    font-size: 0.8rem;
  }

  .status-row span {
    min-width: 50px;
  }

  .log {
    min-height: 200px;
    max-height: 300px;
    font-size: 0.8rem;
  }

  .chat-log {
    min-height: 120px;
    max-height: 180px;
    font-size: 0.8rem;
  }

  .chat-btn {
    padding: 4px 6px;
    font-size: 0.7rem;
  }

  .chat-actions {
    gap: 4px;
  }

  .chip {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .modal-card {
    width: calc(100vw - 8px);
    max-width: none;
    max-height: 85vh;
    border-radius: 12px;
    padding: 12px 8px;
    margin: 0 4px;
  }

  .modal-actions button {
    min-width: 100%;
  }

  .item-tooltip {
    max-width: 200px;
    font-size: 0.85rem;
  }

  .guild-member {
    font-size: 0.85rem;
  }

  .guild-member button {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .summon-details {
    padding: 8px;
  }

  .summon-name {
    font-size: 0.85rem;
  }

  .summon-level {
    font-size: 0.8rem;
  }

  .summon-bar-label {
    width: 36px;
    font-size: 0.75rem;
  }

  .summon-bar {
    height: 6px;
  }

  .summon-stats {
    font-size: 0.75rem;
  }

  .summon-stat {
    padding: 4px;
  }

  .summon-stat-label {
    font-size: 0.65rem;
  }

  .summon-stat-value {
    font-size: 0.8rem;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .chip:hover {
    transform: none;
  }
  
  .chat-btn:hover {
    filter: none;
  }
  
  button:active {
    transform: scale(0.98);
  }
  
  input, select, button {
    min-height: 44px;
  }
  
  .chat-input-row input,
  .trade-row input,
  .trade-row select,
  .trade-row button,
  .modal-actions button {
    min-height: 44px;
  }
}


#bag-modal .modal-card {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

#bag-modal .modal-list-wrapper {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 10px;
}

#bag-modal .modal-actions {
  position: sticky;
  bottom: 0;
  background: #fff5e8;
  padding: 12px 10px;
  border-top: 1px solid rgba(118, 70, 22, 0.15);
  flex-shrink: 0;
  z-index: 10;
}

/* 手机设备优化 */
@media (max-width: 820px) {
  .auth-hero {
    grid-template-columns: 1fr;
  }
  .status-grid {
    grid-template-columns: 1fr;
  }
  .game-grid {
    grid-template-columns: 1fr;
  }
  header h1 {
    font-size: 2.1rem;
  }
  .log {
    min-height: 300px;
  }
}

@media (max-width: 640px) {
  #app {
    padding: 16px 8px 24px;
  }

  header {
    margin-bottom: 16px;
  }

  header h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
  }

  header p {
    font-size: 0.9rem;
  }

  .panel {
    padding: 16px;
    border-radius: 12px;
  }

  .status-card {
    padding: 12px;
  }

  .status-row {
    font-size: 0.85rem;
  }

  .status-row span {
    min-width: 60px;
  }

  .bar {
    height: 8px;
  }

  .bar-label {
    font-size: 0.8rem;
    margin: 4px 0 2px;
  }

  .log-wrap {
    border-radius: 12px;
  }

  .log-header {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .log {
    padding: 12px;
    min-height: 250px;
    max-height: 350px;
    font-size: 0.85rem;
  }

  .chat-wrap {
    border-radius: 12px;
  }

  .chat-header {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .chat-log {
    padding: 10px 12px;
    min-height: 140px;
    max-height: 200px;
    font-size: 0.85rem;
  }

  .chat-actions {
    gap: 6px;
    padding: 8px 12px 4px;
  }

  .chat-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .chat-input-row {
    padding: 8px 12px 10px;
  }

  .chat-input-row input {
    flex: 1;
    min-width: 0;
  }

  .action-group {
    margin-bottom: 12px;
  }

  .action-title {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .chip {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .chip-grid {
    gap: 6px;
  }

  .modal-card {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: 85vh;
    border-radius: 12px;
    padding: 16px 12px;
    margin: 0 8px;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .modal-text {
    font-size: 0.9rem;
  }

  .modal-actions {
    gap: 8px;
    flex-wrap: wrap;
  }

  .modal-actions button {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 10px;
    font-size: 0.9rem;
  }

  .bag-item {
    padding: 8px;
    font-size: 0.85rem;
  }

  .bag-item-name {
    font-size: 0.9rem;
  }

  .bag-item-meta {
    font-size: 0.75rem;
  }

  #trade-item,
  #trade-qty,
  #trade-gold {
    padding: 8px;
    font-size: 0.9rem;
  }

  .trade-panel {
    gap: 12px;
  }

  .trade-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .afk-skill-list {
    gap: 8px;
  }

  .afk-skill-item {
    padding: 8px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  #app {
    padding: 12px 4px 20px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .panel {
    padding: 12px 8px;
  }

  .status-grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .status-row {
    font-size: 0.8rem;
  }

  .status-row span {
    min-width: 50px;
  }

  .log {
    min-height: 200px;
    max-height: 300px;
    font-size: 0.8rem;
  }

  .chat-log {
    min-height: 120px;
    max-height: 180px;
    font-size: 0.8rem;
  }

  .chat-btn {
    padding: 4px 6px;
    font-size: 0.7rem;
  }

  .chat-actions {
    gap: 4px;
  }

  .chip {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .modal-card {
    width: calc(100vw - 8px);
    max-width: none;
    max-height: 85vh;
    border-radius: 12px;
    padding: 12px 8px;
    margin: 0 4px;
  }

  .modal-actions button {
    min-width: 100%;
  }

  .item-tooltip {
    max-width: 200px;
    font-size: 0.85rem;
  }

  .guild-member {
    font-size: 0.85rem;
  }

  .guild-member button {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .summon-details {
    padding: 8px;
  }

  .summon-name {
    font-size: 0.85rem;
  }

  .summon-level {
    font-size: 0.8rem;
  }

  .summon-bar-label {
    width: 36px;
    font-size: 0.75rem;
  }

  .summon-bar {
    height: 6px;
  }

  .summon-stats {
    font-size: 0.75rem;
  }

  .summon-stat {
    padding: 4px;
  }

  .summon-stat-label {
    font-size: 0.65rem;
  }

  .summon-stat-value {
    font-size: 0.8rem;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .chip:hover {
    transform: none;
  }
  
  .chat-btn:hover {
    filter: none;
  }
  
  button:active {
    transform: scale(0.98);
  }
  
  input, select, button {
    min-height: 44px;
  }
  
  .chat-input-row input,
  .trade-row input,
  .trade-row select,
  .trade-row button,
  .modal-actions button {
    min-height: 44px;
  }
}


.repair-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.repair-item {
  border-radius: 12px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.3;
}

.repair-item:hover {
  filter: brightness(1.03);
}

.bag-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bag-item {
  border-radius: 999px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  padding: 6px 10px;
  font-size: 0.85rem;
  text-align: center;
  cursor: pointer;
  line-height: 1.2;
}

.bag-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.bag-tab {
  border-radius: 999px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #3a2311;
  cursor: pointer;
}

.bag-tab.active {
  background: #b65a1a;
  color: #fff;
  border-color: #b65a1a;
}

#stats-summary {
  white-space: pre-line;
}

.bag-item:hover {
  filter: brightness(1.03);
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: #5b3a1c;
}

.rank-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 10px;
  border: 1px solid rgba(118, 70, 22, 0.2);
  background: #f9e9d4;
  padding: 4px 10px;
}

.rank-item .rank-pos {
  font-weight: 600;
  color: #8f4a12;
}

.guild-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px;
}

.guild-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.guild-member .tag {
  background: #d07a2c;
  color: #fff7ea;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
}

.guild-member button {
  min-width: 64px;
}

/* 队伍管理界面按钮样式 */
.party-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.party-actions button {
  flex: 1;
  min-width: 120px;
}

.party-actions button.hidden {
  display: none;
}

.party-follow-leader {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.party-follow-leader button {
  width: 100%;
}

.afk-skill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.afk-skill-item {
  border-radius: 999px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  padding: 6px 10px;
  font-size: 0.85rem;
  text-align: center;
  cursor: pointer;
  line-height: 1.2;
}

.afk-skill-item:hover {
  filter: brightness(1.03);
}

.afk-skill-item.selected {
  background: #c56b2a;
  color: #fff7ea;
  border-color: #b35a1a;
}

.summon-details {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #fff4e2;
  border: 1px solid #ead0ad;
}

.summon-name {
  font-weight: 600;
  color: #5b3a1c;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.summon-level {
  font-size: 0.85rem;
  color: #6b4a2a;
  margin-bottom: 8px;
}

.summon-bar-row {
  display: flex;
  align-items: center;
  margin: 4px 0;
}

.summon-bar-label {
  width: 40px;
  font-size: 0.8rem;
  color: #6b4a2a;
}

.summon-bar {
  flex: 1;
  height: 8px;
  background: #e8d4b9;
  border-radius: 999px;
  overflow: hidden;
  margin-left: 6px;
}

.summon-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.summon-bar-fill.hp { background: linear-gradient(90deg, #8b1f1f, #d05a2f); }
.summon-bar-fill.exp { background: linear-gradient(90deg, #1f6b3b, #35b36c); }

.summon-stats {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(118, 70, 22, 0.15);
  font-size: 0.8rem;
  color: #6b4a2a;
  text-align: center;
}

.summon-stat {
  padding: 6px;
  background: rgba(255, 247, 234, 0.5);
  border-radius: 6px;
  display: inline-block;
}

.summon-stat-label {
  display: block;
  font-size: 0.7rem;
  color: #8b6a4a;
  margin-bottom: 2px;
}

.summon-stat-value {
  font-weight: 600;
  color: #5b3a1c;
  font-size: 0.9rem;
}

#player-info {
  white-space: pre-line;
}

.log p {
  margin: 0 0 8px;
  white-space: pre-wrap;
}

.log-line,
.chat-log .log-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-log .announce-line {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.chat-log .announce-line .line-text {
  display: inline-block;
  will-change: transform;
}

@keyframes announce-bounce {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(var(--marquee-shift, 0));
  }
}

.line-prefix {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(120, 64, 20, 0.85);
  color: #fff3df;
  font-weight: 600;
  font-size: 0.78rem;
  border: 1px solid rgba(255, 210, 150, 0.4);
}

.prefix-announce {
  background: #b55610;
  color: #fff7ea;
}

.line-rare { color: #69b6ff; }
.line-epic { color: #ff7fc8; }
.line-legendary { color: #f2c464; }
.line-announce { color: #d8792f; }

.chip.rarity-common { border-color: rgba(118, 70, 22, 0.25); }
.chip.rarity-uncommon { border-color: rgba(60, 130, 70, 0.45); color: #2f6b3b; }
.chip.rarity-rare { border-color: rgba(72, 140, 210, 0.55); color: #2f6aa6; }
.chip.rarity-epic { border-color: rgba(196, 94, 178, 0.55); color: #8a2c7a; }
.chip.rarity-legendary { border-color: rgba(212, 152, 68, 0.6); color: #8f5a12; }
.chip.item-set { box-shadow: 0 0 0 1px rgba(214, 145, 64, 0.4); }

.side {
  background: #fffdf7;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #f0dcc2;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 190, 0.4);
}

.action-group {
  margin-bottom: 14px;
}

.action-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chip {
  border-radius: 999px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.chip.active {
  background: #c56b2a;
  color: #fff7ea;
  border-color: #b35a1a;
}

.chip.small {
  font-size: 0.75rem;
  padding: 4px 8px;
}

.chip.player-friendly {
  border-color: rgba(58, 134, 213, 0.55);
  color: #2f6aa6;
  background: #eef5ff;
}

.chip.player-enemy {
  border-color: rgba(210, 92, 92, 0.55);
  color: #b63c3c;
  background: #fff0f0;
}

.summon-details {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #fff4e2;
  border: 1px solid #ead0ad;
}

.summon-name {
  font-weight: 600;
  color: #5b3a1c;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.summon-level {
  font-size: 0.85rem;
  color: #6b4a2a;
  margin-bottom: 8px;
}

.summon-bar-row {
  display: flex;
  align-items: center;
  margin: 4px 0;
}

.summon-bar-label {
  width: 40px;
  font-size: 0.8rem;
  color: #6b4a2a;
}

.summon-bar {
  flex: 1;
  height: 8px;
  background: #e8d4b9;
  border-radius: 999px;
  overflow: hidden;
  margin-left: 6px;
}

.summon-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.summon-bar-fill.hp { background: linear-gradient(90deg, #8b1f1f, #d05a2f); }
.summon-bar-fill.exp { background: linear-gradient(90deg, #1f6b3b, #35b36c); }

.summon-stats {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(118, 70, 22, 0.15);
  font-size: 0.8rem;
  color: #6b4a2a;
  text-align: center;
}

.summon-stat {
  padding: 6px;
  background: rgba(255, 247, 234, 0.5);
  border-radius: 6px;
  display: inline-block;
}

.summon-stat-label {
  display: block;
  font-size: 0.7rem;
  color: #8b6a4a;
  margin-bottom: 2px;
}

.summon-stat-value {
  font-weight: 600;
  color: #5b3a1c;
  font-size: 0.9rem;
}

.item-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(32, 18, 8, 0.96);
  color: #f7e6d3;
  border: 1px solid rgba(233, 194, 144, 0.5);
  box-shadow: 0 12px 24px rgba(20, 12, 6, 0.4);
  font-size: 0.85rem;
  white-space: pre-line;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.item-tooltip.hidden {
  display: none;
}

.item-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

/* 观察弹窗样式 */
.observe-content {
  background: var(--panel);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  font-size: 0.95rem;
  line-height: 1.8;
}

.observe-section {
  margin-bottom: 16px;
}

.observe-section:last-child {
  margin-bottom: 0;
}

.observe-section-title {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  font-size: 1rem;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 4px;
}

.observe-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.observe-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.observe-stat-label {
  color: var(--ink);
  opacity: 0.7;
}

.observe-stat-value {
  font-weight: 600;
  color: var(--accent);
}

.observe-equipment-list,
.observe-summon-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.observe-equipment-item,
.observe-summon-item {
  background: var(--accent-soft);
  padding: 8px 12px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.observe-equipment-name,
.observe-summon-name {
  font-weight: 500;
  color: var(--ink);
}

.observe-equipment-durability,
.observe-summon-stats {
  font-size: 0.85rem;
  color: var(--ink);
  opacity: 0.7;
}

.target-label {
  margin-bottom: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff4e2;
  border: 1px solid #ead0ad;
  font-size: 0.85rem;
}

.side h3 {
  margin-top: 0;
  font-family: var(--font-display);
}

.input-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
}

#cmd-input {
  flex: 1;
  font-family: var(--font-mono);
  background: #fffdf7;
}

ul {
  padding-left: 18px;
  margin: 8px 0;
}

li {
  margin-bottom: 6px;
}

@media (max-width: 820px) {
  .auth-hero {
    grid-template-columns: 1fr;
  }
  .status-grid {
    grid-template-columns: 1fr;
  }
  .game-grid {
    grid-template-columns: 1fr;
  }
  header h1 {
    font-size: 2.1rem;
  }
  .log {
    min-height: 300px;
  }
}

/* 套装掉落表样式 */
.drops-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.drops-tab {
  flex: 1;
  min-width: 70px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(118, 70, 22, 0.25);
  background: #f7e2c6;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.12s ease;
}

.drops-tab:hover {
  background: #e8d4b8;
}

.drops-tab.active {
  background: #c56b2a;
  color: #fff7ea;
  border-color: #b35a1a;
}

.drops-content {
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px 0;
}

.drops-header {
  font-weight: 600;
  color: #8f5a12;
  padding: 8px 0;
  font-size: 1rem;
  border-bottom: 1px solid rgba(118, 70, 22, 0.15);
  margin-bottom: 10px;
}

.drops-item {
  background: #fff4e2;
  border: 1px solid rgba(118, 70, 22, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.drops-item-name {
  font-weight: 600;
  color: #5b3a1c;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.drops-item-mobs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: #6b4a2a;
}

.drops-drop {
  background: #fff7ea;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(118, 70, 22, 0.1);
}

#drops-modal .modal-card {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

#drops-modal .modal-list-wrapper {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 10px;
}

#drops-modal .modal-actions {
  position: sticky;
  bottom: 0;
  background: #fff5e8;
  padding: 12px 10px;
  border-top: 1px solid rgba(118, 70, 22, 0.15);
  flex-shrink: 0;
  z-index: 10;
}

/* 技能进度条样式 */
.skill-progress {
  margin-top: 4px;
  height: 4px;
  background: #e8d4b9;
  border-radius: 999px;
  overflow: hidden;
}

.skill-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #1f6b3b, #35b36c);
  border-radius: 999px;
  transition: width 0.3s ease;
}

body.dark .skill-progress {
  background: #3a3028;
}

body.dark .skill-progress-bar {
  background: linear-gradient(90deg, #2a8a5a, #4ac77a);
}

/* BOSS刷新时间样式 */
.boss-respawn-time {
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff4e2;
  border: 1px solid #ead0ad;
  font-size: 0.85rem;
  color: #6b4a2a;
  text-align: center;
  margin-bottom: 8px;
}

body.dark .boss-respawn-time {
  background: #2a2420;
  border-color: #4a3828;
  color: #a89888;
}

.boss-respawn-time #boss-respawn-timer {
  color: #c86b2a;
  font-weight: 600;
}

body.dark .boss-respawn-time #boss-respawn-timer {
  color: #e8a058;
}

