﻿/*
Theme Name: D3 Tools Theme
Author: Your Name
Description: Diablo 3 综合工具自定义主题 — 暗黑风格重制版
Version: 2.0.0
*/

/* ============================================
   Design Tokens — Diablo Style
   ============================================ */
:root {
  --bg:             #0A0A0A;
  --bg-alt:         #050505;
  --surface:        #141414;
  --surface-hover:  #1f1f1f;
  --surface-alt:    #0f0f0f;
  --primary:        #c92a2a;
  --primary-hover:  #e03131;
  --primary-muted:  rgba(201, 42, 42, 0.15);
  --accent:         #c8a84e;
  --accent-hover:   #dbb95a;
  --accent-muted:   rgba(200, 168, 78, 0.15);
  --text:           #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-muted:     #888888;
  --border:         #2B2C2C;
  --border-light:   #383838;
  --border-focus:   #c92a2a;
  --border-gold:    #c8a84e;
  --success:        #2b8a3e;
  --error:          #c92a2a;
  --warning:        #e67700;
  --glow-red:       0 0 12px rgba(201, 42, 42, 0.3);
  --glow-gold:      0 0 12px rgba(200, 168, 78, 0.25);
  --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:      0 4px 8px rgba(0, 0, 0, 0.5);
  --shadow-inner:   inset 0 1px 0 rgba(255, 255, 255, 0.03), inset 0 2px 4px rgba(0, 0, 0, 0.4);
  --radius:         0.5rem;
  --radius-sm:      0.25rem;
  --font-display:   'Cinzel', Georgia, serif;
  --font-body:      'Inter', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  max-width: 1400px;
  min-width: 320px;
  margin: 0 auto;
  padding: 0 20px 60px;
  background: var(--bg-alt);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: 1400px; }

/* ============================================
   Header + Nav Block — Diablo Dark
   ============================================ */
.header-nav-block {
  width: 100%;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
}

header {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-alt);
  color: var(--text);
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  pointer-events: none;
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
  letter-spacing: 0.04em;
  text-shadow: 0 0 20px rgba(200, 168, 78, 0.2);
  position: relative;
}

header h1 a {
  color: var(--accent);
  text-decoration: none;
}

header h1 a:hover {
  color: var(--accent-hover);
  text-shadow: 0 0 30px rgba(200, 168, 78, 0.4);
}

/* ============================================
   Navigation — Rectangular Tabs
   ============================================ */
nav {
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
  border-top: 1px solid var(--border);
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.65rem 1.25rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

nav a:last-child { border-right: none; }

nav a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

 nav a.active {
  color: var(--accent);
  background: var(--surface);
  box-shadow: inset 0 -2px 0 var(--accent);
 }

/* ============================================
   Sections & Cards
   ============================================ */
.page-content { display: none; }
.page-content.active { display: block; }

.section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-inner);
  border: 1px solid var(--border);
  transition: border-color 0.3s ease;
}

.section:hover {
  border-color: var(--border-light);
}

h2 {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
  position: relative;
  text-transform: uppercase;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--accent);
}

/* ============================================
   Form Elements — Dark + Red Focus
   ============================================ */
input, select, button, a.button-link, textarea {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  box-sizing: border-box;
}

input, select, textarea {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

button, a.button-link {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.625rem 1.25rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  box-shadow: 0 0 1px var(--border) inset;
}

button:hover, a.button-link:hover {
  background: var(--surface-hover);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 1px var(--accent) inset;
}

button:active, a.button-link:active {
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
  color: var(--accent-hover);
}

button:disabled, a.button-link:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ============================================
   Input Groups
   ============================================ */
.merge-input-group,
.diff-input-group,
.future-input-group {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.875rem;
  align-items: center;
  margin: 1rem 0;
}

.merge-input-group label,
.diff-input-group label,
.future-input-group label {
  text-align: right;
  padding-right: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 42px;
}

.merge-input-group button,
.diff-input-group button,
.future-input-group button {
  grid-column: span 2;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem;
  font-size: 1rem;
}

.speed-input-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  align-items: stretch;
}

.speed-input-row input,
.speed-input-row select {
  flex: 1;
  min-width: 0;
  height: 42px;
  line-height: normal;
  padding: 0 0.75rem;
}

/* ============================================
   Results — Dark panels
   ============================================ */
.result {
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.result > div {
  margin-bottom: 0.625rem;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--border);
}

.result > div:last-child { border-bottom: none; }

.result strong {
  color: var(--text);
  font-weight: 500;
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.125rem;
}

.result .result-data {
  color: var(--text-secondary);
  display: block;
  padding-left: 1rem;
  font-size: 0.9375rem;
}

.result .bold-text {
  color: var(--accent) !important;
  font-weight: 700 !important;
  font-family: var(--font-display);
  font-size: 1.0625rem !important;
  letter-spacing: 0.02em;
}

.result .green-text {
  color: var(--success) !important;
}

.result .green-bold {
  color: var(--success) !important;
  font-weight: 700 !important;
}

/* ============================================
   Season Rewards
   ============================================ */
.season-rewards-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.2fr);
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.season-rewards-table .header {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-display);
  text-align: center;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: 1px solid var(--border);
}

.season-rewards-table .header:first-child {
  background: transparent;
  border: none;
}

.season-rewards-table .class-name,
.season-rewards-table .set-name-simp,
.season-rewards-table .set-name-trad {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0.5rem;
  word-break: break-word;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: 1px solid var(--border);
}

.season-rewards-table .class-name {
  color: var(--primary);
  font-weight: 600;
  border: 1px solid var(--border);
}

.season-rewards-table .set-name-simp,
.season-rewards-table .set-name-trad {
  background: var(--surface);
  color: var(--text);
}

#seasonSelect {
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  line-height: normal;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  margin-bottom: 0.75rem;
}

/* ============================================
   Post Cards — Dark style
   ============================================ */
.other-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
  width: 100%;
}

@media (min-width: 630px) { .other-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .other-list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .other-list { grid-template-columns: repeat(4, 1fr); } }

.post-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  height: 100%;
  padding: 1.5rem;
  box-sizing: border-box;
}

.post-card:hover {
  border-color: var(--border-gold);
  background: var(--surface-hover);
}

.post-card-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card-content h3 {
  color: var(--text);
  margin: 0 0 0.625rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

.post-card-content p {
  color: var(--text-secondary);
  margin: 0 0 1rem;
  line-height: 1.6;
  font-size: 0.875rem;
  flex-grow: 1;
}

.post-card:not(.no-thumbnail) { padding: 0; }
.post-card:not(.no-thumbnail) .post-card-content { padding: 1.25rem; }
.post-card:not(.no-thumbnail) .post-card-content h3 { font-size: 1.0625rem; margin-bottom: 0.5rem; }
.post-card:not(.no-thumbnail) .post-card-content p { font-size: 0.8125rem; }

.post-card-thumbnail {
  width: 100%;
  height: 180px;
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
}

.post-card.pinned-post { border: 2px solid var(--border-gold) !important; }

/* ============================================
   Post Card States — Important & Visited
   ============================================ */

/* Important card — amber left accent bar, warm tint, "推荐" badge */
.post-card--important {
  border-left: 3px solid #d4a84b;
  background: rgba(200, 168, 78, 0.04);
}

.post-card--important:hover {
  border-color: var(--border-gold);
  border-left: 3px solid #d4a84b;
  background: var(--surface-hover);
}

.important-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  color: #d4a84b;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 2;
  padding: 0.125rem 0.5rem;
  border: 1px solid rgba(212, 168, 75, 0.3);
  border-radius: 2px;
  background: rgba(212, 168, 75, 0.08);
}

/* Visited card — subtly reduced title, small check in corner */
.post-card--visited .post-card-content h3,
.post-card--visited.post-card .post-card-content h3 {
  opacity: 0.55;
}

.post-card--visited .post-card-content p {
  opacity: 0.4;
}

.visited-mark {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 2;
  opacity: 0.7;
}

/* Pinned + Important combined — both badges visible */
.post-card.pinned-post.post-card--important {
  border-left: 3px solid #d4a84b;
  border-top: 2px solid var(--border-gold);
  border-right: 2px solid var(--border-gold);
  border-bottom: 2px solid var(--border-gold);
}

.pinned-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

.post-card.no-thumbnail .pinned-badge { top: 0.75rem; right: 0.75rem; }

/* ============================================
   Loading & Error States
   ============================================ */
.loading, .error {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  grid-column: 1 / -1;
}

.error { color: var(--error); }

.fade-out { opacity: 0; transition: opacity 0.35s ease; }
.fade-in { opacity: 1; transition: opacity 0.35s ease; }

/* ============================================
   Visit Counter — Dark panel style
   ============================================ */
.visit-counter {
  position: fixed;
  right: 1.25rem;
  bottom: 3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  text-align: center;
}

.visit-counter span {
  color: var(--accent);
  font-weight: 700;
}

/* ============================================
   Footer — Dark bar
   ============================================ */
.site-info-footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 0.5rem 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  z-index: 99;
}

.site-info-footer p {
  margin: 0;
  text-align: center;
}

.site-info-footer i.fa,
.site-info-footer .fa {
  margin-right: 0.375rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  vertical-align: middle;
}

.site-info-footer a {
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  margin: 0 0.25rem;
  transition: color 0.2s;
}

.site-info-footer a:hover {
  color: var(--accent) !important;
  text-decoration: underline !important;
}

/* ============================================
   Single Post — Dark container
   ============================================ */
.single-post-container {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-inner);
  border: 1px solid var(--border);
}

.single-post-title {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
  position: relative;
}

.single-post-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 80px;
  height: 2px;
  background: var(--accent);
}

.single-post-content {
  line-height: 1.8;
  color: var(--text);
}

.single-post-content p { margin-bottom: 1.25em; }
.single-post-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ============================================
   Server Toggle — Segmented buttons
   ============================================ */
.server-toggle {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 0.75rem;
}

.server-btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.server-btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.server-btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.server-btn.active {
  background: var(--primary);
  color: var(--accent);
  border-color: var(--primary);
}

.server-btn:not(.active):hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* ============================================
   Flatpickr Overrides
   ============================================ */
.flatpickr-calendar {
  font-family: var(--font-body) !important;
}

.flatpickr-calendar .flatpickr-time input.numInput {
  font-weight: normal !important;
}

.flatpickr-input[readonly] {
  background-color: var(--surface) !important;
  cursor: pointer;
}

/* ============================================
   Responsive — Tablet & Mobile
   ============================================ */
@media (max-width: 800px) {
  nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 0;
    border-top: 1px solid var(--border);
  }

  nav a {
    font-size: 0.8125rem;
    padding: 0.65rem 0.5rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  nav a:nth-child(2n) { border-right: none; }

  .merge-input-group,
  .diff-input-group,
  .future-input-group {
    display: block;
    margin-bottom: 1.5rem;
  }

  .merge-input-group label,
  .diff-input-group label,
  .future-input-group label {
    display: block;
    text-align: left;
    padding-right: 0;
    height: auto;
    padding-top: 0.75rem;
    margin-bottom: 0.375rem;
    justify-content: flex-start;
  }

  .merge-input-group input,
  .diff-input-group input,
  .future-input-group input,
  .merge-input-group select,
  .diff-input-group select,
  .future-input-group select {
    width: 100%;
    margin-bottom: 0.75rem;
  }

  .merge-input-group button,
  .diff-input-group button,
  .future-input-group button {
    width: 100%;
    margin-top: 0.5rem;
  }

  .result .result-data { padding-left: 0.75rem; }
  .result strong { padding-left: 0; }

  .season-rewards-table.portrait-mode {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    align-items: center;
  }

  .season-rewards-table.portrait-mode .header { display: none; }

  .season-rewards-table.portrait-mode .class-name,
  .season-rewards-table.portrait-mode span:not(.class-name) {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.375rem;
    background: transparent;
    word-break: break-word;
    font-size: 0.8125rem;
  }

  .season-rewards-table.portrait-mode .class-name {
    color: var(--primary);
    font-weight: 600;
  }

  .season-rewards-table.portrait-mode span:not(.class-name) {
    color: var(--text);
  }

  .speed-input-row input,
  .speed-input-row select {
    flex: 1;
    min-width: 0;
    width: auto;
  }
}

@media (max-width: 380px) {
  body { padding: 0 0.75rem 3rem; margin: 0.5rem auto; }
  .section { padding: 1rem; }
  header h1 { font-size: 1.375rem; }
  h2 { font-size: 1rem; }
}

