/* ========== 基础与变量 ========== */
:root {
  --bg-1: #0c1220;
  --bg-2: #1a2744;
  --accent: #5b9bd5;
  --accent-soft: rgba(91, 155, 213, 0.35);
  --text: #e8eef5;
  --text-muted: rgba(232, 238, 245, 0.65);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.12);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-1);
  position: relative;
  overflow-x: hidden;
}

/* ========== 背景 ========== */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(91, 155, 213, 0.25), transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 75%, rgba(138, 99, 210, 0.2), transparent 50%),
    linear-gradient(165deg, var(--bg-1) 0%, var(--bg-2) 100%);
  pointer-events: none;
}

/* ========== 布局 ========== */
.app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) 1rem 4rem;
}

/* ========== 液态玻璃面板 ========== */
.glass.panel {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
  margin-bottom: 1.25rem;
  padding: 1.35rem 1.5rem;
}

.header {
  text-align: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ========== 表单 ========== */
.record-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.record-input {
  width: 100%;
  padding: 0.9rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  resize: vertical;
  min-height: 88px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.record-input::placeholder {
  color: rgba(232, 238, 245, 0.4);
}

.record-input:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, rgba(91, 155, 213, 0.85), rgba(100, 130, 200, 0.75));
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(91, 155, 213, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(100, 165, 220, 0.95), rgba(110, 140, 210, 0.85));
}

.btn-ghost {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
  flex-shrink: 0;
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-icon:hover {
  color: #f0a0a0;
  border-color: rgba(240, 160, 160, 0.35);
}

/* ========== 列表 ========== */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.list-header .section-title {
  margin-bottom: 0;
}

.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.record-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.record-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: itemIn 0.35s ease;
}

@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.record-body {
  flex: 1;
  min-width: 0;
}

.record-text {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.record-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.empty-hint {
  margin: 0;
  padding: 1.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-hint[hidden] {
  display: none;
}

/* ========== 页脚与无障碍 ========== */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 1rem 2rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .record-item {
    animation: none;
  }

  .btn:active {
    transform: none;
  }
}

/* ========== 首页与导航 ========== */
.app--home {
  max-width: 560px;
}

.header--home {
  padding-top: clamp(2rem, 6vw, 3rem);
  padding-bottom: clamp(1.25rem, 4vw, 2rem);
}

.home-intro .section-title {
  margin-bottom: 1rem;
}

.tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tool-card {
  margin: 0;
}

.tool-card-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 1.1rem 1.15rem;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.tool-card-link:hover {
  border-color: var(--accent-soft);
  background: rgba(91, 155, 213, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tool-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.tool-card-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.tool-card-cta {
  font-size: 0.82rem;
  color: var(--accent);
  margin-top: 0.25rem;
}

.page-nav {
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--accent);
}
