/* ============================================
   Workshop Web - Complete Stylesheet
   Brand: Dark green #0d5e2e, Gold #ffd700
   All text in Simplified Chinese
   ============================================ */

:root {
  --primary: #0d5e2e;
  --primary-light: #15803d;
  --primary-dark: #064e1b;
  --accent: #ffd700;
  --accent-light: #ffe44d;
  --accent-dark: #ccac00;
  --bg: #f5f7f6;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-light: #6b7280;
  --text-white: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 20px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.25s ease;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --max-width: 980px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---- Header / Nav ---- */
header {
  background: var(--primary);
  color: var(--text-white);
  padding: 0 1.25rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

header .site-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

header nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header nav a {
  color: var(--text-white);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: background var(--transition);
  white-space: nowrap;
}

header nav a:hover,
header nav a.active {
  background: rgba(255,255,255,0.15);
  text-decoration: none;
}

/* ---- Main Content ---- */
main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

/* ---- Hero Section ---- */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 500px;
  margin: 0 auto;
}

/* ---- Card Grid ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card .card-icon {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.card p {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.5;
}

.card .badge {
  display: inline-block;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.card .coming-soon {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  backdrop-filter: blur(2px);
  border-radius: var(--radius);
}

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

/* =============================================
   FORM STYLING
   ============================================= */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,94,46,0.12);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 3px 10px rgba(13,94,46,0.3);
}

.btn-accent {
  background: var(--accent);
  color: var(--primary-dark);
}

.btn-accent:hover {
  background: var(--accent-light);
  box-shadow: 0 3px 10px rgba(255,215,0,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-white);
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* =============================================
   AUTH PAGES (login.html)
   ============================================= */
.auth-container {
  max-width: 400px;
  margin: 2rem auto;
}

.auth-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 0.6rem 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}

.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.auth-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.auth-form .error-msg {
  color: #dc2626;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  min-height: 1.2em;
}

.auth-form .success-msg {
  color: var(--primary);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

/* =============================================
   CHAT PAGE
   ============================================= */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px - 3rem);
  max-height: calc(100vh - 56px - 3rem);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  max-width: 80%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  line-height: 1.5;
  font-size: 0.92rem;
  word-wrap: break-word;
  animation: msgIn 0.25s ease;
}

.chat-message.user {
  align-self: flex-end;
  background: var(--primary);
  color: var(--text-white);
  border-bottom-right-radius: 4px;
}

.chat-message.assistant {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}

.chat-message.assistant.loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-message .msg-sender {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.15rem;
}

.chat-message.user .msg-sender {
  color: rgba(255,255,255,0.7);
  text-align: right;
}

.chat-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chat-input-area input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  font-family: var(--font);
}

.chat-input-area input:focus {
  border-color: var(--primary);
}

.chat-input-area .btn {
  padding: 0.65rem 1.2rem;
}

/* =============================================
   MUSIC PAGE
   ============================================= */
.music-container {
  max-width: 600px;
  margin: 0 auto;
}

.music-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.music-form .form-group textarea {
  min-height: 100px;
}

.music-results {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
}

.music-results h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.music-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.music-player .play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}

.music-player .play-btn:hover {
  background: var(--primary-light);
}

.music-player .track-info {
  flex: 1;
  min-width: 0;
}

.music-player .track-info .track-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.music-player .track-info .track-status {
  font-size: 0.78rem;
  color: var(--text-light);
}

.music-player audio {
  display: none;
}

.music-lyrics {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.7;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

.music-version {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

.music-version:last-child {
  margin-bottom: 0;
}

.music-version .version-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =============================================
   BACK BUTTON
   ============================================= */
.back-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.back-header .back-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--primary);
  padding: 0.25rem;
  display: flex;
  align-items: center;
}

.back-header .back-btn:hover {
  color: var(--primary-light);
}

.back-header h2 {
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 700;
}

/* =============================================
   LOADING SPINNER
   ============================================= */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 4px;
}

.spinner-white {
  border-color: rgba(255,255,255,0.3);
  border-top-color: white;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   PAGE & OFFICE STYLES
   ============================================ */
.page-container {
  max-width: 640px;
  margin: 0 auto;
}

.office-form .form-group {
  margin-bottom: 1.2rem;
}
.office-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.file-upload-area:hover {
  border-color: var(--primary);
  background: rgba(13,94,46,0.03);
}
.file-upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.file-upload-text {
  font-size: 0.9rem;
  color: var(--text);
}
.file-upload-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.3rem;
}
.file-selected {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
}

.office-result-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  text-align: center;
}
.office-result-card .result-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.back-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.back-header .back-btn {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 700;
  line-height: 1;
}
.back-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.login-gate {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 3rem 2rem;
  text-align: center;
}
.login-gate p {
  margin-bottom: 1.2rem;
  color: var(--text-light);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  font-size: 0.88rem;
  font-weight: 500;
  border-left: 4px solid var(--primary);
  animation: toastIn 0.3s ease;
  max-width: 340px;
}

.toast.error {
  border-left-color: #dc2626;
}

.toast.success {
  border-left-color: var(--primary);
}

.toast.warning {
  border-left-color: var(--accent);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* =============================================
   UTILITY
   ============================================= */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
display: none !important; }

/* Badge for coming-soon cards */
.badge {
display: inline-block;
background: var(--accent);
color: var(--primary-dark);
font-size: 0.72rem;
font-weight: 700;
padding: 0.15rem 0.5rem;
border-radius: 20px;
vertical-align: middle;
margin-left: 0.3rem;
}

/* =============================================
 FOOTER
 ============================================= */
footer {
text-align: center;
padding: 1.5rem;
color: var(--text-light);
font-size: 0.82rem;
margin-top: auto;
}

/* Login gate overlay */
.login-gate {
  text-align: center;
  padding: 3rem 1rem;
}

.login-gate p {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  header .header-inner {
    height: auto;
    padding: 0.6rem 0;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  header .site-name {
    font-size: 1.05rem;
  }

  header nav {
    gap: 0.2rem;
  }

  header nav a {
    padding: 0.3rem 0.5rem;
    font-size: 0.82rem;
  }

  .hero {
    padding: 1.5rem 0.5rem 1rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  main {
    padding: 1rem 0.85rem;
  }

  .chat-message {
    max-width: 90%;
    font-size: 0.88rem;
  }

  .auth-container {
    margin: 1rem auto;
  }

  .music-container {
    max-width: 100%;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
  }

  .toast {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  header .site-name {
    font-size: 0.95rem;
  }

  header nav a {
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
  }

  .hero h1 {
    font-size: 1.25rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .chat-container {
    height: calc(100vh - 56px - 2rem);
  }
}
