/* =========================================
   ARCLINE · style.css
   palette: #aebcb5 sage + white base
   ========================================= */

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

:root {
  --sage:       #aebcb5;
  --sage-dk:    #8a9a92;
  --sage-lt:    #cfdfdb;
  --sage-pale:  #eef4f2;
  --ink:        #111111;
  --ink2:       #444444;
  --ink3:       #888888;
  --ink4:       #bbbbbb;
  --surface:    #ffffff;
  --bg:         #f7f9f8;
  --border:     #e4e9e6;
  --player-h:   68px;
  --nav-h:      52px;
  --danger:     #d64545;
}

body {
  font-family: -apple-system, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

/* ── UTILITIES ── */
.hidden { display: none !important; }

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 0;
}
.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--sage-dk);
  margin-right: 28px;
  cursor: pointer;
  user-select: none;
}
.nav-links { display: flex; flex: 1; }
.nav-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink3);
  height: var(--nav-h);
  padding: 0 14px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.nav-tab:hover { color: var(--ink); }
.nav-tab.active { color: var(--ink); border-bottom-color: var(--sage); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn-outline {
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink2);
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.btn-outline:hover { border-color: var(--sage); color: var(--sage-dk); }
.btn-fill {
  font-size: 12px;
  padding: 5px 14px;
  border: none;
  border-radius: 4px;
  background: var(--sage);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s;
}
.btn-fill:hover { background: var(--sage-dk); }
.user-chip {
  font-size: 12px;
  color: var(--ink2);
  background: var(--sage-pale);
  padding: 5px 10px;
  border-radius: 4px;
}

/* ── PAGES ── */
.page { display: none; padding-bottom: calc(var(--player-h) + 16px); }
.page.active { display: block; }

/* ── HOME LAYOUT ── */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  max-width: 1060px;
  margin: 0 auto;
}
.main-col {
  padding: 24px 20px 0;
  border-right: 1px solid var(--border);
}
.side-col { padding: 24px 16px 0; }

/* ── GENERIC SECTIONS ── */
.page-wrap { max-width: 800px; margin: 0 auto; padding: 24px 20px 0; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sec-ttl { font-size: 15px; font-weight: 700; color: var(--ink); }
.sec-more {
  font-size: 12px;
  color: var(--sage-dk);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
}
.sec-more:hover { text-decoration: underline; }
.chart-sub { font-size: 12px; color: var(--ink3); margin-left: 8px; font-weight: 400; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── CHART TABLE ── */
.chart-table { width: 100%; border-collapse: collapse; }
.chart-table tr { cursor: pointer; transition: background .1s; }
.chart-table tr:hover { background: var(--sage-pale); }
.chart-table tr.now-playing { background: var(--sage-pale); }
.chart-table td { padding: 7px 5px; vertical-align: middle; }

.now-bar { width: 3px; height: 36px; background: var(--sage); border-radius: 2px; display: none; margin-right: 2px; }
.chart-table tr.now-playing .now-bar { display: block; }

.rank-n { font-size: 13px; font-weight: 700; color: var(--ink3); width: 26px; text-align: center; }
.rank-n.top { color: var(--sage-dk); }

.cover-box {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  background: var(--sage-lt);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-box img { width: 100%; height: 100%; object-fit: cover; }
.cover-box .emoji { font-size: 20px; }

.td-info { padding-left: 10px; }
.trk-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.trk-sub {
  font-size: 11px;
  color: var(--ink3);
  margin-top: 1px;
  cursor: pointer;
  display: inline-block;
}
.trk-sub:hover { color: var(--sage-dk); text-decoration: underline; }
.td-plays { font-size: 11px; color: var(--ink4); text-align: right; white-space: nowrap; padding-right: 8px; }
.td-play { width: 36px; text-align: right; }
.play-circ {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink3);
  font-size: 13px;
  transition: all .12s;
}
.play-circ:hover, .play-circ.active { border-color: var(--sage); color: var(--sage-dk); }
.play-circ.active { background: var(--sage-pale); }

/* ── ALBUM GRID ── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.alb-card { cursor: pointer; transition: opacity .15s; }
.alb-card:hover { opacity: .8; }
.alb-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--sage-lt);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  position: relative;
}
.alb-cover img { width: 100%; height: 100%; object-fit: cover; }
.alb-cover .alb-emoji { font-size: 40px; }
.alb-ttl { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alb-art {
  font-size: 11px;
  color: var(--sage-dk);
  margin-top: 2px;
  cursor: pointer;
  display: inline-block;
}
.alb-art:hover { text-decoration: underline; }

/* ── ARTIST ROW ── */
.artist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .1s;
}
.artist-row:hover { background: var(--sage-pale); }
.art-ava {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sage-lt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}
.art-ava img { width: 100%; height: 100%; object-fit: cover; }
.art-name { font-size: 13px; font-weight: 600; }
.art-genre { font-size: 11px; color: var(--ink3); margin-top: 1px; }
.art-fans { font-size: 11px; color: var(--ink4); margin-left: auto; white-space: nowrap; }

/* ── ARTIST CHANNEL ── */
.ch-banner {
  background: var(--sage-pale);
  border-bottom: 1px solid var(--border);
  padding: 28px 20px;
}
.ch-inner { max-width: 800px; margin: 0 auto; display: flex; align-items: center; gap: 20px; }
.ch-ava {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--sage-lt);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
  overflow: hidden;
}
.ch-ava img { width: 100%; height: 100%; object-fit: cover; }
.ch-name { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.ch-genre { font-size: 12px; color: var(--ink3); margin-top: 3px; }
.ch-stats { display: flex; gap: 20px; margin-top: 8px; }
.ch-stat { font-size: 12px; color: var(--ink3); }
.ch-stat strong { color: var(--ink); font-weight: 700; }
.follow-btn {
  margin-top: 10px;
  padding: 6px 18px;
  border-radius: 4px;
  border: 1px solid var(--sage);
  background: var(--surface);
  color: var(--sage-dk);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .12s;
}
.follow-btn:hover { background: var(--sage); color: #fff; }
.follow-btn.following { background: var(--sage); color: #fff; border-color: var(--sage-dk); }

/* ── UPLOAD ── */
.up-form { max-width: 560px; margin: 0 auto; padding: 28px 20px; }
.up-ttl { font-size: 18px; font-weight: 800; margin-bottom: 24px; }
.fg { margin-bottom: 16px; }
.fl { display: block; font-size: 12px; color: var(--ink3); font-weight: 500; margin-bottom: 6px; }
.fi {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .12s;
  font-family: inherit;
}
.fi:focus { border-color: var(--sage); }
.fi::placeholder { color: var(--ink4); }

.drop-area {
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.drop-area:hover { border-color: var(--sage); background: var(--sage-pale); }
.track-drop { padding: 18px; }
.drop-ico { font-size: 26px; color: var(--ink4); margin-bottom: 8px; }
.drop-txt { font-size: 13px; color: var(--ink3); }
.drop-hint { font-size: 11px; color: var(--ink4); margin-top: 3px; }

.trk-upload-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.trk-up-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sage-pale);
  border-radius: 5px;
  padding: 8px 12px;
}
.trk-up-row .trk-idx { font-size: 12px; color: var(--ink3); width: 18px; text-align: right; flex-shrink: 0; }
.trk-up-row input {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--ink);
  flex: 1;
  outline: none;
  font-family: inherit;
}
.trk-up-del {
  background: none;
  border: none;
  color: var(--ink4);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px;
  transition: color .12s;
}
.trk-up-del:hover { color: var(--danger); }

.submit-btn {
  width: 100%;
  background: var(--sage);
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
  font-family: inherit;
  margin-top: 4px;
}
.submit-btn:hover { background: var(--sage-dk); }
.submit-btn:disabled { background: var(--ink4); cursor: not-allowed; }

.up-progress { margin-top: 12px; }
.up-progress-bar { width: 100%; height: 4px; background: var(--sage-lt); border-radius: 3px; overflow: hidden; }
.up-progress-fill { height: 100%; background: var(--sage-dk); border-radius: 3px; width: 0%; transition: width .2s; }
.up-progress-txt { font-size: 12px; color: var(--ink3); margin-top: 6px; display: block; }

/* ── AUTH ── */
.auth-wrap { min-height: 500px; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  width: 380px;
  max-width: 100%;
}
.auth-logo { font-size: 22px; font-weight: 800; color: var(--sage-dk); margin-bottom: 4px; }
.auth-sub { font-size: 12px; color: var(--ink3); margin-bottom: 24px; }
.auth-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--ink3);
  padding: 8px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  transition: background .12s, color .12s;
}
.auth-tab.active { background: var(--sage); color: #fff; font-weight: 700; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-foot { font-size: 11px; color: var(--ink4); margin-top: 12px; text-align: center; line-height: 1.8; }
.auth-foot a { color: var(--sage-dk); cursor: pointer; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* ── PLAYER ── */
.player {
  position: sticky;
  bottom: 0;
  z-index: 90;
  height: var(--player-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}
.p-track { display: flex; align-items: center; gap: 12px; width: 200px; flex-shrink: 0; }
.p-cover {
  width: 42px;
  height: 42px;
  border-radius: 5px;
  background: var(--sage-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--sage);
  flex-shrink: 0;
  overflow: hidden;
}
.p-cover img { width: 100%; height: 100%; object-fit: cover; }
.p-info { min-width: 0; }
.p-tname { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-artist { font-size: 11px; color: var(--ink3); }

.p-controls { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: center; }
.p-btn {
  background: none;
  border: none;
  color: var(--ink3);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color .12s;
}
.p-btn:hover { color: var(--ink); }
.p-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sage);
  border: none;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s;
}
.p-play:hover { background: var(--sage-dk); }

.p-progress-wrap { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 360px; }
.p-time { font-size: 11px; color: var(--ink4); white-space: nowrap; }
.p-bar { flex: 1; height: 3px; background: var(--sage-lt); border-radius: 3px; overflow: hidden; cursor: pointer; position: relative; }
.p-fill { height: 100%; background: var(--sage); border-radius: 3px; transition: width .4s linear; pointer-events: none; }

.p-vol { display: flex; align-items: center; gap: 6px; color: var(--ink3); font-size: 16px; flex-shrink: 0; }
.p-vol input[type=range] {
  -webkit-appearance: none;
  width: 70px;
  height: 3px;
  background: var(--sage-lt);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.p-vol input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sage);
  cursor: pointer;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: calc(var(--player-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 20px;
  z-index: 200;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ── LOADING STATE ── */
.loading-row td { text-align: center; padding: 40px; color: var(--ink3); font-size: 13px; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .home-grid { grid-template-columns: 1fr; }
  .side-col { border-top: 1px solid var(--border); }
  .album-grid { grid-template-columns: repeat(2, 1fr); }
  .p-vol { display: none; }
  .p-track { width: 140px; }
}
