/* Tang Code Search - Ancient Chinese Inspired Dark Theme */

:root {
  --bg-primary: #141210;
  --bg-secondary: #1e1c18;
  --bg-card: #252320;
  --text-primary: #e8e0d5;
  --text-secondary: #a89f94;
  --text-muted: #6b635a;
  --accent: #c4a35a;
  --accent-dim: #8b7340;
  --border: #3a3530;
  --border-light: #4a453e;
}

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

html {
  font-size: 16px;
}

body {
  font-family: 'Noto Serif SC', 'Georgia', serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.title-chinese {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.3em;
  margin-bottom: 0.25rem;
}

.title-english {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Search Section */
.search-section {
  margin-bottom: 2rem;
}

.search-box {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.search-box input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 2px rgba(196, 163, 90, 0.15);
}

.search-box input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.search-box button {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.search-box button:hover:not(:disabled) {
  background: #d4b36a;
}

.search-box button:active:not(:disabled) {
  transform: scale(0.98);
}

.search-box button:disabled {
  background: var(--accent-dim);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Status */
.status {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.5rem;
}

.status-ready {
  color: var(--accent);
}

.status-error {
  color: #c45a5a;
}

/* Results */
.results {
  flex: 1;
}

.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
  font-style: italic;
}

/* Result Card */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.result-header {
  padding: 1.25rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.result-title {
  margin-bottom: 0.5rem;
}

.article-number {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.result-title h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.title-cn {
  color: var(--text-primary);
  margin-right: 0.5rem;
}

.title-en {
  color: var(--text-secondary);
  font-weight: 400;
  text-transform: capitalize;
}

.title-pinyin {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.95rem;
  font-style: italic;
}

.result-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.chapter {
  color: var(--text-muted);
}

.relevance {
  color: var(--accent);
  font-weight: 600;
}

/* Law Text & Commentary Sections */
.law-text,
.commentary {
  padding: 1.25rem 1.5rem;
}

.law-text {
  border-bottom: 1px solid var(--border);
}

.law-text h4,
.commentary h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-dim);
  margin-bottom: 0.75rem;
}

.text-chinese {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.text-english {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.text-chinese:last-child,
.text-english:last-child {
  margin-bottom: 0;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-note {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .title-chinese {
    font-size: 2.25rem;
    letter-spacing: 0.2em;
  }

  .title-english {
    font-size: 1.25rem;
  }

  .search-box {
    flex-direction: column;
  }

  .search-box button {
    width: 100%;
  }

  .result-header {
    padding: 1rem 1.25rem;
  }

  .law-text,
  .commentary {
    padding: 1rem 1.25rem;
  }

  .result-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Selection */
::selection {
  background: rgba(196, 163, 90, 0.3);
  color: var(--text-primary);
}
