:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #14213d;
  --accent: #e76f51;
  --border: #d6deeb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: linear-gradient(135deg, #eef3fb 0%, #f9f2ec 100%);
  color: var(--text);
}

#common-header,
#common-nav,
#common-footer {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-inner h1 {
  margin: 0;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-logo {
  width: 216px;
  height: auto;
  display: inline-block;
  vertical-align: middle;
}

.sub-title {
  font-size: 12px;
  color: #687893;
}

.header-inner .user-info {
  position: relative;
  display: flex;
  align-items: center;
}

.header-inner .user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d7ddeb;
  border-radius: 18px;
  background: #ffffff;
  color: #1f2d45;
  padding: 6px 12px;
  cursor: pointer;
}

.header-inner .user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: #202124;
  border: 1px solid #2f3136;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.35);
  padding: 12px;
  display: none;
  z-index: 1100;
}

.header-inner .user-info.open .user-dropdown {
  display: block;
}

.header-inner .user-card {
  background: linear-gradient(160deg, #0f172a, #0b1638);
  border: 1px solid #1f2a44;
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  margin-bottom: 10px;
}

.header-inner .user-card-avatar {
  font-size: 34px;
  margin-bottom: 6px;
}

.header-inner .username {
  color: #f8fafc;
  font-size: 22px;
  line-height: 1.2;
}

.header-inner .user-email {
  color: #cbd5e1;
  font-size: 14px;
  margin-top: 4px;
  word-break: break-all;
}

.header-inner .header-link {
  display: block;
  color: #e5e7eb;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 15px;
  margin-top: 4px;
}

.header-inner .header-link:hover {
  color: #ffffff;
  background: #2b2d31;
}

.header-inner .logout-btn {
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  background-color: transparent;
  color: #e5e7eb;
  border: 1px solid #3f4349;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
  text-align: left;
}

.header-inner .logout-btn:hover {
  color: #ffffff;
  background-color: #2b2d31;
}

.nav-list {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 16px;
  list-style: none;
  display: flex;
  gap: 10px;
}

.nav-link {
  text-decoration: none;
  color: #2a3a58;
  padding: 6px 12px;
  border-radius: 8px;
}

.nav-link.active {
  background: var(--accent);
  color: #fff;
}

#common-footer {
  border-top: 1px solid var(--border);
  border-bottom: none;
  margin-top: 20px;
}

.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 16px;
  text-align: center;
  font-size: 12px;
  color: #687893;
}

.container {
  max-width: 980px;
  margin: 24px auto;
  padding: 0 16px;
}

h1 { margin: 8px 0 20px; }

.account-row {
  margin-bottom: 12px;
  font-size: 13px;
}

.account-row a {
  color: #2f5ea8;
  text-decoration: none;
}

.account-row a:hover {
  text-decoration: underline;
}

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

.alarm-editor {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

.alarm-form {
  display: grid;
  gap: 18px;
}

.time-panel {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 12px 0 4px;
}

.time-panel label {
  color: #687893;
}

.time-panel input {
  width: min(320px, 100%);
  height: 76px;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  font-size: 48px;
  text-align: center;
  color: #111827;
  background: transparent;
}

.alarm-fields {
  display: grid;
  gap: 14px;
}

.repeat-block {
  display: grid;
  gap: 8px;
}

.repeat-title {
  font-size: 14px;
  color: #4b5563;
}

.tab-head {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  width: auto;
  min-width: 110px;
  background: #d1d9e8;
  color: #2a3a58;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

form {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.weekdays label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #d7ddeb;
  border-radius: 50%;
  background: #ffffff;
  color: #2a3a58;
  cursor: pointer;
  font-size: 14px;
}

.weekdays input {
  display: none;
}

.weekdays label:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.primary-action {
  width: 100%;
  height: 44px;
  border-radius: 10px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.form-actions .primary-action {
  width: 100%;
}

#cancelEditAlarmBtn {
  height: 44px;
  white-space: nowrap;
}

.switch-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.switch-row input {
  width: auto;
}

.holiday-form {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 12px;
  align-items: end;
}

.setting-options {
  display: grid;
  gap: 12px;
}

.setting-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  cursor: pointer;
}

.setting-option input {
  width: auto;
}

.setting-option span {
  display: grid;
  gap: 4px;
}

.setting-option small {
  color: #64748b;
}

.upload-row {
  display: flex;
  gap: 10px;
}

#musicFile {
  flex: 1;
  padding-top: 6px;
}

#musicSelect {
  flex: 1;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0 10px;
  font-size: 14px;
  background: #fff;
}

input, button {
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0 10px;
  font-size: 14px;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  width: 120px;
}

button:hover { opacity: 0.92; }

.delete-btn {
  background: #9a2a2a;
  margin-left: 6px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th, td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 8px;
  font-size: 13px;
}

.music-table td:nth-child(2),
.music-table td:nth-child(3),
.music-table td:nth-child(4) {
  color: #52627a;
  white-space: nowrap;
}

.music-table .selected-row {
  background: #fff7ed;
}

.music-play-status {
  color: #687893;
  font-weight: 600;
}

.music-play-status.is-playing {
  color: #166534;
}

.music-play-status.is-paused {
  color: #a16207;
}

.play-music-btn,
.delete-music-btn {
  width: 72px;
  margin-right: 6px;
}

.play-music-btn {
  background: #2f5ea8;
}

.delete-music-btn {
  background: #9a2a2a;
}

.empty-cell {
  text-align: center;
  color: #687893;
  padding: 18px 8px;
}

.msg {
  min-height: 20px;
  color: #2a6f2e;
}

.setting-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px;
  position: relative;
}

.setting-toast.success {
  background: rgba(22, 163, 74, 0.95);
}

.setting-toast.error {
  background: rgba(220, 38, 38, 0.95);
}

.setting-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  min-width: 180px;
  max-width: 320px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(37, 99, 235, 0.95);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.setting-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.setting-title {
  margin-bottom: 16px;
  font-size: 24px;
  color: #2d3748;
}

.setting-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.setting-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: #374151;
}

.setting-row {
  margin-bottom: 12px;
}

.setting-row label {
  display: block;
  margin-bottom: 6px;
  color: #4b5563;
}

.setting-row input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.setting-btn {
  border: none;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
}

.user-info-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px;
}

.user-info-title {
  margin-bottom: 16px;
  font-size: 24px;
  color: #2d3748;
}

.user-info-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
}

.user-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed #e5e7eb;
  padding: 10px 0;
}

.user-info-row:last-child {
  border-bottom: none;
}

.user-info-row .label {
  color: #4b5563;
}

.user-info-row .value {
  color: #111827;
  font-weight: 600;
}

.progress-wrap {
  display: grid;
  gap: 8px;
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e8edf7;
  overflow: hidden;
  cursor: pointer;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #e76f51 0%, #f4a261 100%);
  transition: width 0.35s ease;
}

.progress-text {
  font-size: 13px;
  color: #435270;
}
