:root {
  --bg: #ffffff;
  --bg-page: #fafafa;
  --bg-soft: #f5f5f6;
  --border: #e8e8ea;
  --text: #16161a;
  --text-soft: #6b6b74;
  --text-faint: #9a9aa2;
  --black: #111113;
  --white: #ffffff;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-w: 232px;
  --aside-w: 260px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

svg {
  display: block;
  flex-shrink: 0;
}

/* ---------- layout ---------- */

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-top {
  padding: 20px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 24px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 500;
  font-size: 13.5px;
}

.nav-item svg {
  width: 17px;
  height: 17px;
}

.nav-item:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.nav-item.active {
  background: var(--bg-soft);
  color: var(--text);
}

.sidebar-bottom {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.plan-box {
  padding: 10px 4px 16px;
}

.plan-label {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.plan-name {
  font-weight: 600;
  color: var(--text);
}

.progress {
  height: 5px;
  border-radius: 3px;
  background: var(--bg-soft);
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--black);
  border-radius: 3px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 0;
}

.user-row .avatar {
  width: 26px;
  height: 26px;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  flex-grow: 1;
}

.user-row .dots {
  color: var(--text-faint);
}

.main {
  flex-grow: 1;
  min-width: 0;
  padding: 32px 40px 60px;
}

.content {
  max-width: 760px;
}

.content-wide {
  max-width: 980px;
}

/* ---------- topbar / headers ---------- */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header h1 {
  font-size: 22px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.page-subtitle {
  color: var(--text-soft);
  font-size: 13.5px;
  margin: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 13px;
  margin-bottom: 14px;
}

.breadcrumb a {
  color: var(--text-soft);
}

.breadcrumb a:hover {
  color: var(--text);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
}

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

.btn-primary:hover {
  background: #000;
}

.btn-outline {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--bg-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  padding: 9px 10px;
}

.btn-ghost:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-soft);
  color: var(--text-soft);
}

/* ---------- inputs ---------- */

.field-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 0 12px;
  height: 42px;
}

.input-group svg {
  width: 16px;
  height: 16px;
  color: var(--text-faint);
}

.input-group input {
  border: none;
  outline: none;
  flex-grow: 1;
  font-size: 13.5px;
  background: transparent;
  color: var(--text);
}

.input-group input::placeholder {
  color: var(--text-faint);
}

.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-row .input-group {
  flex-grow: 1;
}

/* ---------- cards ---------- */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ---------- list rows (reels / competitors) ---------- */

.list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 24px 0 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  border-radius: var(--radius);
}

.row:hover {
  background: var(--bg-soft);
}

.thumb {
  position: relative;
  width: 52px;
  height: 78px;
  border-radius: 9px;
  background: linear-gradient(160deg, #2a2a30, #17171b);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.thumb svg {
  width: 16px;
  height: 16px;
}

.thumb .duration {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
}

.row-body {
  flex-grow: 1;
  min-width: 0;
}

.row-title {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tags {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-soft);
  border-radius: 5px;
  padding: 2px 7px;
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-faint);
}

.row-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.row-meta svg {
  width: 13px;
  height: 13px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.competitor-row .row-title {
  margin-bottom: 3px;
}

.competitor-row .row-meta {
  color: var(--text-soft);
}

/* ---------- promo box ---------- */

.promo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.promo-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 3px;
}

.promo-text {
  font-size: 12.5px;
  color: var(--text-soft);
}

.promo .icon-btn {
  color: var(--text-faint);
}

/* ---------- reel detail page ---------- */

.detail-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.detail-main {
  flex-grow: 1;
  min-width: 0;
  max-width: 620px;
}

.detail-aside {
  width: var(--aside-w);
  flex-shrink: 0;
}

.section {
  margin-bottom: 28px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: 14.5px;
  margin: 0;
}

.edit-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-faint);
}

.edit-link svg {
  width: 12px;
  height: 12px;
}

.edit-link:hover {
  color: var(--text-soft);
}

.section-body {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.65;
}

.section-body p {
  margin: 0 0 8px;
}

.section-body ul {
  margin: 0;
  padding-left: 18px;
}

.section-body li {
  margin-bottom: 6px;
}

.section-body b {
  font-weight: 600;
}

.comment {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.comment-body {
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.5;
}

.comment-author {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-faint);
}

.aside-block {
  margin-bottom: 26px;
}

.aside-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.source-meta {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.source-thumb {
  width: 120px;
  height: 214px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #2a2a30, #17171b);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  overflow: hidden;
}

.source-thumb .num {
  font-size: 40px;
  font-weight: 800;
}

.source-thumb .caption {
  position: absolute;
  bottom: 28px;
  left: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.source-thumb .play {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.9);
}

.source-stats {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-faint);
}

.source-stats .meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.source-stats svg {
  width: 13px;
  height: 13px;
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
