@import url('./theme.css');

* {
      box-sizing: border-box;
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    html {
      scroll-behavior: smooth;
    }

    html, body {
      margin: 0;
      min-height: 100%;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", Arial, sans-serif;
      color: var(--text);
      background: var(--bg);
      line-height: 1.5;
    }

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

    .container {
      width: min(1200px, calc(100% - 32px));
      margin: 0 auto;
    }

    .header {
      position: sticky;
      top: 0;
      z-index: 100;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
    }

    .header-inner {
      min-height: 72px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
      padding: 10px 0;
    }

    .brand-wrap {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .brand-text {
      display: flex;
      flex-direction: column;
      gap: 2px;
      line-height: 1.15;
    }

    .brand-title {
      font-size: 20px;
      font-weight: 800;
      letter-spacing: -0.02em;
      color: var(--text);
    }

    .brand-sub {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.12em;
      color: var(--muted);
      text-transform: uppercase;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 26px;
      padding: 0 10px;
      border-radius: 999px;
      border: 1px solid #bae6fd;
      background: var(--primary-light);
      color: var(--primary-dark);
      font-size: 12px;
      font-weight: 700;
    }

    .menu {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .menu-link {
      padding: 10px 12px;
      border-radius: 10px;
      color: var(--text);
      font-size: 14px;
      font-weight: 600;
      transition: color 0.15s ease, background 0.15s ease;
    }

    .menu-link:hover,
    .menu-link:focus-visible {
      color: var(--primary);
      background: var(--primary-light);
    }

    .main {
      padding: 28px 0 56px;
    }

    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-card);
      transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    .card.interactive:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    }

    .section-head {
      margin: 0 0 16px;
    }

    .section-title {
      margin: 0 0 6px;
      font-size: 22px;
      font-weight: 800;
      letter-spacing: -0.02em;
      color: var(--text);
    }

    .section-desc {
      margin: 0;
      font-size: 14px;
      color: var(--muted);
    }

    .section-block {
      margin-top: 36px;
    }

    .section-block--first {
      margin-top: 0;
    }

    .hero {
      padding: 28px 28px 26px;
      margin-bottom: 8px;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 20px;
      flex-wrap: wrap;
    }

    .hero h1 {
      margin: 0 0 8px;
      font-size: 28px;
      font-weight: 800;
      letter-spacing: -0.02em;
      color: var(--text);
    }

    .hero p {
      margin: 0;
      color: var(--muted);
      font-size: 15px;
    }

    .service-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 16px;
    }

    .service-card {
      padding: 22px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-height: 100%;
    }

    .service-card h3 {
      margin: 0;
      font-size: 17px;
      font-weight: 800;
      letter-spacing: -0.02em;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .service-card p {
      margin: 0;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.65;
      flex: 1;
    }

    .service-actions {
      margin-top: auto;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .service-icon {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: var(--primary-light);
      color: var(--primary-dark);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
    }

    a.service-card-link {
      display: block;
      color: inherit;
    }

    a.service-card-link:focus-visible {
      outline: 2px solid var(--primary);
      outline-offset: 2px;
    }

    .tag-pill {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 800;
      background: var(--primary-light);
      color: var(--primary-dark);
      border: 1px solid #bae6fd;
    }

    .tag-pill.muted {
      background: #f3f4f6;
      color: var(--muted);
      border-color: var(--border);
    }

    .btn {
      min-height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0 16px;
      border-radius: 12px;
      border: 1px solid transparent;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      transition: 0.16s ease;
      font-family: inherit;
    }

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

    .btn-primary {
      background: var(--primary);
      color: #ffffff;
      border-color: var(--primary);
    }

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

    .btn-secondary {
      background: #ffffff;
      color: var(--text);
      border-color: var(--border);
    }

    .btn-secondary:hover {
      border-color: var(--primary);
      color: var(--primary-dark);
    }

    .btn-ghost {
      background: var(--primary-light);
      color: var(--primary-dark);
      border-color: #bae6fd;
    }

    .btn-ghost:hover {
      background: #dbeafe;
    }

    .btn-sm {
      min-height: 36px;
      padding: 0 12px;
      font-size: 13px;
      border-radius: 10px;
    }

    .class-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
    }

    .class-card {
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .class-thumb {
      aspect-ratio: 16 / 9;
      background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 45%, #7dd3fc 100%);
      border-bottom: 1px solid var(--border);
    }

    .class-thumb.alt {
      background: linear-gradient(135deg, #fef3c7 0%, #fde68a 40%, #fcd34d 100%);
    }

    .class-body {
      padding: 18px 20px 20px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      flex: 1;
    }

    .class-body h3 {
      margin: 0;
      font-size: 17px;
      font-weight: 800;
    }

    .class-meta {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    .class-placeholder-note {
      margin: 0;
      font-size: 13px;
      color: var(--muted);
    }

    .split-2 {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
    }

    .notice-list {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 0;
    }

    .notice-list li {
      border-bottom: 1px solid var(--border);
      padding: 12px 0;
      font-size: 14px;
      color: var(--text);
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: baseline;
    }

    .notice-list li:last-child {
      border-bottom: none;
    }

    .notice-date {
      font-size: 12px;
      color: var(--muted);
      flex-shrink: 0;
    }

    .card-header-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }

    .link-soft {
      font-size: 13px;
      font-weight: 700;
      color: var(--primary-dark);
    }

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

    .shortcut-list {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .shortcut-list a {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 14px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: #fafafa;
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      transition: border-color 0.15s, background 0.15s;
    }

    .shortcut-list a:hover {
      border-color: var(--primary);
      background: var(--primary-light);
      color: var(--primary-dark);
    }

    .shortcut-list a span {
      color: var(--muted);
      font-size: 18px;
      font-weight: 400;
    }

    /* 상품 카드 컴포넌트 */
    .product-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
    }

    .product-card {
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .product-thumb {
      aspect-ratio: 16 / 10;
      background: linear-gradient(160deg, #f3f4f6 0%, #e5e7eb 50%, #d1d5db 100%);
      border-bottom: 1px solid var(--border);
    }

    .product-body {
      padding: 18px 20px 22px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex: 1;
    }

    .product-cat {
      font-size: 12px;
      font-weight: 700;
      color: var(--muted);
    }

    .product-body h3 {
      margin: 0;
      font-size: 17px;
      font-weight: 800;
    }

    .product-body p {
      margin: 0;
      font-size: 14px;
      color: var(--muted);
      line-height: 1.6;
      flex: 1;
    }

    .product-price {
      margin-top: 8px;
      font-size: 18px;
      font-weight: 800;
      color: var(--primary-dark);
    }

    /* 게시판 */
    .board-search {
      margin-bottom: 16px;
      position: relative;
    }

    .board-search input[type="search"] {
      width: 100%;
      min-height: 46px;
      padding: 0 44px 0 16px;
      border-radius: 12px;
      border: 1px solid var(--border);
      font-size: 14px;
      background: var(--surface);
    }

    .board-search input[type="search"]:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
    }

    .board-search .search-icon {
      position: absolute;
      right: 14px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted);
      pointer-events: none;
      font-size: 16px;
    }

    .board-table {
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      overflow: hidden;
      background: var(--surface);
      box-shadow: var(--shadow-card);
    }

    .board-row {
      display: grid;
      grid-template-columns: 1fr auto auto;
      gap: 16px;
      align-items: center;
      padding: 14px 18px;
      border-bottom: 1px solid var(--border);
      font-size: 14px;
      transition: background 0.15s ease;
    }

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

    .board-row:hover {
      background: #f9fafb;
    }

    .board-row.pinned {
      background: #fffbeb;
    }

    .board-title {
      font-weight: 600;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .pin-ico {
      font-size: 14px;
    }

    .board-meta {
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--muted);
      font-size: 13px;
      white-space: nowrap;
    }

    .pagination {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 6px;
      margin-top: 20px;
      flex-wrap: wrap;
    }

    .page-btn {
      min-width: 38px;
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--surface);
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
      cursor: default;
    }

    .page-btn.active {
      background: var(--primary);
      border-color: var(--primary);
      color: #fff;
    }

    /* 마이페이지 3열 */
    #apiPanel {
      scroll-margin-top: 88px;
    }

    .mypage-head {
      margin-bottom: 18px;
    }

    .mypage-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
      align-items: stretch;
    }

    .mypage-card {
      padding: 22px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      min-height: 100%;
    }

    .card-title {
      margin: 0;
      font-size: 17px;
      font-weight: 800;
      color: var(--text);
    }

    .card-sub {
      margin: -6px 0 0;
      font-size: 13px;
      color: var(--muted);
      line-height: 1.5;
    }

    .panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      flex-wrap: wrap;
    }

    .sub {
      margin: 0;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.7;
    }

    .auth-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .api-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .field.full {
      grid-column: 1 / -1;
    }

    label {
      font-size: 13px;
      color: var(--text);
      font-weight: 700;
    }

    input {
      width: 100%;
      min-height: 42px;
      padding: 0 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      outline: none;
      font-size: 14px;
    }

    input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
    }

    .help {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.6;
    }

    .small {
      color: var(--muted);
      font-size: 12px;
    }

    .toolbar {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 4px;
    }

    .message {
      display: none;
      margin-top: 12px;
      padding: 12px 14px;
      border-radius: 10px;
      font-size: 13px;
      line-height: 1.6;
      border: 1px solid var(--border);
      background: var(--primary-light);
      color: var(--primary-dark);
    }

    .message.ok {
      display: block;
      border-color: #bae6fd;
      background: var(--primary-light);
      color: var(--primary-dark);
    }

    .message.err {
      display: block;
      border-color: var(--border);
      background: #f9fafb;
      color: var(--muted);
    }

    .footer-note {
      margin-top: 8px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.6;
    }

    .status {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 32px;
      padding: 0 12px;
      border-radius: 999px;
      border: 1px solid #bae6fd;
      background: var(--primary-light);
      color: var(--primary-dark);
      font-size: 13px;
      font-weight: 700;
    }

    .status.off {
      border-color: var(--border);
      background: #f3f4f6;
      color: var(--muted);
    }

    .profile-rows {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .profile-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
      font-size: 14px;
    }

    .profile-row:last-child {
      border-bottom: none;
      padding-bottom: 0;
    }

    .profile-label {
      color: var(--muted);
      font-size: 13px;
      font-weight: 600;
    }

    .profile-val {
      font-weight: 600;
      text-align: right;
      word-break: break-all;
    }

    .coupon-input-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .coupon-input-row input {
      flex: 1;
      min-width: 140px;
    }

    .coupon-item {
      padding: 12px 14px;
      border-radius: 12px;
      border: 1px dashed var(--border);
      background: #fafafa;
      font-size: 13px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
    }

    .coupon-items {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .coupon-expired {
      font-size: 11px;
      font-weight: 800;
      padding: 2px 8px;
      border-radius: 999px;
      background: var(--primary-light);
      color: var(--primary-dark);
      border: 1px solid #bae6fd;
    }

    .site-footer {
      border-top: 1px solid var(--border);
      margin-top: 12px;
      padding: 22px 0 32px;
      color: var(--muted);
      font-size: 13px;
      background: var(--surface);
    }

    .site-footer-inner {
      max-width: min(1120px, calc(100% - 32px));
      margin: 0 auto;
      padding: 24px;
      color: var(--muted);
      font-size: 13px;
    }

    .site-footer-inner .footer-links {
      margin-bottom: 10px;
    }

    .site-footer-inner p {
      margin: 0;
    }

    .footer-links {
      display: flex;
      flex-wrap: wrap;
      gap: 16px;
      margin-bottom: 8px;
    }

    .footer-links a {
      color: var(--muted);
      text-decoration: none;
    }

    .footer-links a:hover {
      color: var(--primary-dark);
    }

    .footer-fine {
      margin-top: 10px;
      font-size: 11px;
      color: #9ca3af;
      line-height: 1.6;
    }

    .empty-board {
      background: #fff;
      border: 1px solid #e5e7eb;
      border-radius: 18px;
      min-height: 220px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      color: #6b7280;
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
      padding: 32px 24px;
      text-align: center;
    }

    .empty-board strong {
      color: #111827;
      font-size: 18px;
      font-weight: 800;
    }

    .empty-board p {
      margin: 0;
      font-size: 14px;
      line-height: 1.6;
      color: #6b7280;
    }

    .empty-icon {
      font-size: 32px;
      line-height: 1;
    }

    .empty-board.notice-empty .empty-icon,
    .empty-board.board-empty .empty-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: #e0f2fe;
      font-size: 28px;
      box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35);
    }

    #dashboard {
      scroll-margin-top: 88px;
    }

    #products,
    #notices {
      scroll-margin-top: 88px;
    }

    @media (max-width: 1100px) {
      .service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 980px) {
      .split-2,
      .class-grid {
        grid-template-columns: 1fr;
      }

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

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

      .board-row {
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .board-meta {
        justify-content: flex-start;
      }
    }

    @media (max-width: 768px) {
      .service-grid {
        grid-template-columns: 1fr;
      }

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

      .header-inner {
        flex-direction: column;
        align-items: flex-start;
      }

      .menu {
        width: 100%;
        justify-content: flex-start;
      }

      .hero h1 {
        font-size: 22px;
      }

      .brand-wrap {
        width: 100%;
        justify-content: space-between;
      }
    }

.brand-wrap--link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.menu-link.is-active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.brand-wrap--link:hover .brand-title {
  color: var(--primary-dark);
}

.mypage-stack {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

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

.toggle-row span {
  color: var(--text);
  font-weight: 600;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e5e7eb;
  transition: 0.2s;
  border-radius: 999px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

.switch input:checked + .slider {
  background: var(--primary);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.switch input:focus-visible + .slider {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.payment-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
  font-size: 14px;
}

.price-inline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.product-price-muted {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.btn-muted {
  background: #ffffff;
  color: var(--muted);
  border-color: var(--border);
}

.btn-muted:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}
