/* 梦幻西游工具站 - 公共样式 */
:root {
  --bg: #0a0a12;
  --bg2: #12121e;
  --card: #1a1a2e;
  --card2: #16213e;
  --accent: #e94560;
  --accent2: #0f3460;
  --text: #eaeaea;
  --muted: #a0a0b0;
  --green: #00d9a5;
  --gold: #ffd700;
  --orange: #ff8c00;
  --border: #2a2a40;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 导航栏 */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 700;
}

.nav-brand .logo {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--border);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg2);
    flex-direction: column;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* 页面标题 */
.page-header {
  text-align: center;
  padding: 40px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}

.page-header h1 {
  font-size: 1.8rem;
  color: var(--gold);
  letter-spacing: 2px;
}

.page-header p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 1.15rem;
  color: var(--gold);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

/* 工具网格 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px 0;
}

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  cursor: pointer;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tool-card .icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.tool-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.tool-card p {
  font-size: 0.8rem;
  color: var(--muted);
}

.tool-card .tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  margin-top: 8px;
}

.tag-new { background: var(--accent); color: #fff; }
.tag-hot { background: var(--orange); color: #fff; }
.tag-done { background: var(--green); color: #000; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 5px;
}
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }

/* 按钮 */
.btn {
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
  font-weight: 600;
}
.btn:hover { opacity: 0.85; }
.btn-block { width: 100%; }

/* 结果面板 */
.result-box {
  background: var(--card2);
  border-radius: 10px;
  padding: 18px;
  margin-top: 16px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.result-cell {
  text-align: center;
}

.result-cell .num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green);
}

.result-cell .num.negative { color: var(--accent); }
.result-cell .num.gold { color: var(--gold); }
.result-cell .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 10px;
}
th, td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--muted);
  font-weight: 500;
  background: var(--card2);
}
tr:hover td { background: rgba(255,255,255,0.03); }

/* 页脚 */
footer {
  text-align: center;
  padding: 30px 0;
  color: #555;
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* 布局 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* 选项卡 */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab {
  padding: 10px 22px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.95rem;
  transition: all 0.2s;
  user-select: none;
}
.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.tab:hover:not(.active) { background: var(--border); color: var(--text); }

.panel { display: none; }
.panel.active { display: block; }

/* 帮助文字 */
.help-text {
  color: #666;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: 8px;
}

/* 高亮 */
.highlight { color: var(--gold); font-weight: 600; }

/* 颜色点 */
.dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.dot-green { background: #4ade80; }
.dot-cyan { background: #22d3ee; }
.dot-purple { background: #c084fc; }
.dot-black { background: #6b7280; }
.dot-white { background: #e5e7eb; }
.dot-red { background: #f87171; }
.dot-yellow { background: #facc15; }
.dot-blue { background: #60a5fa; }
.dot-gold { background: #ffd700; }
