/* 一起AI Netlify application layer.
 * The visual foundation remains site/assets/css/style.css; this file only
 * adds dynamic states and responsive components used by the real app. */
:root {
  --focus: #8a5a2b;
  --danger: #a33f2a;
  --danger-soft: #fbe8e2;
  --success: #2f6b4e;
  --success-soft: #e6f0e9;
}

body { min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button:disabled { cursor: not-allowed; opacity: .58; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(224, 120, 86, .42);
  outline-offset: 2px;
}
.skip-link {
  position: fixed; left: 16px; top: 10px; z-index: 100;
  transform: translateY(-180%); background: var(--ink); color: #fff;
  padding: 8px 12px; border-radius: 8px; font-size: 13px;
}
.skip-link:focus { transform: translateY(0); }
.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;
}
.app-main { min-height: 620px; }
.global-status {
  max-width: 1200px; margin: 14px auto 0; padding: 10px 16px;
  border: 1px solid #cfe3d8; border-radius: 11px; background: var(--success-soft);
  color: var(--success); font-size: 13px;
}
.global-status.error { border-color: #f0c6ba; background: var(--danger-soft); color: var(--danger); }
.global-status.info { border-color: #e8c98f; background: #fff7e8; color: var(--ink-2); }

.menu-toggle { display: none; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; color: var(--ink); width: 38px; height: 38px; }
.auth-link { color: var(--ink-2); font-size: 13.5px; }
.auth-link:hover { color: var(--ink); }
.auth-register { padding: 7px 13px; font-size: 13px; }
.hd-right [hidden] { display: none !important; }
.bean-pill { white-space: nowrap; }
.avatar { flex: 0 0 auto; }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 42px 0 22px; }
.page-head h1 { font-size: clamp(25px, 4vw, 34px); line-height: 1.25; letter-spacing: -.02em; }
.page-head p { color: var(--ink-2); font-size: 14px; margin-top: 8px; max-width: 620px; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { color: #8a5a2b; font-weight: 700; letter-spacing: .06em; font-size: 12px; }
.muted { color: var(--ink-3); }
.subtle { color: var(--ink-2); font-size: 13px; }
.empty-state, .error-state, .loading-state {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  padding: 44px 24px; text-align: center; color: var(--ink-2);
}
.empty-state h2, .error-state h2, .loading-state h2 { color: var(--ink); font-size: 18px; margin-bottom: 8px; }
.error-state { border-color: #f0c6ba; background: #fffaf8; }
.error-state .btn, .empty-state .btn { margin-top: 18px; }
.skeleton { background: linear-gradient(90deg, #f0e8dc 25%, #faf5ee 37%, #f0e8dc 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* Home */
.home-hero { padding-top: 58px; }
.home-hero .hero-img img { object-position: center; }
.home-hero .hero-copy { min-width: 0; }
.hero-note { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12px; margin-top: 14px; }
.hero-note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.stats:empty { display: none; }
.stat-value-empty { color: var(--ink-3); font-weight: 500 !important; font-size: 15px !important; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { padding: 24px; }
.feature-card h3 { font-size: 17px; margin: 10px 0 7px; }
.feature-card p { font-size: 13.5px; color: var(--ink-2); }
.feature-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--bean-soft); color: var(--bean); font-weight: 800; }
.home-cta { margin-top: 56px; }
.home-cta p { max-width: 560px; }
.asset-preview-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #eee2d2, #d9ccb9); color: #6b5b47; font-size: 32px; font-weight: 800; }

/* Library */
.library-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 30px 0 18px; }
.search-form { display: flex; gap: 8px; flex: 1; min-width: min(100%, 360px); }
.search-form input, .search-form select, .field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px;
  background: #fff; color: var(--ink); min-height: 43px;
}
.search-form input:focus, .search-form select:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--cta-deep); outline: none; }
.search-form input { flex: 1; min-width: 0; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; color: var(--ink-2); padding: 7px 12px; font-size: 13px; cursor: pointer; }
.filter-pill.active, .filter-pill:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.library-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 14px 0; }
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.asset-card { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; transition: .18s; }
.asset-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(74,54,32,.28); }
.asset-card-media { display: block; aspect-ratio: 4/3; overflow: hidden; background: #eee6d9; }
.asset-card-media img, .asset-card-media video { width: 100%; height: 100%; object-fit: cover; }
.asset-card-body { padding: 15px 16px 17px; }
.asset-card-body h2 { font-size: 15px; line-height: 1.4; margin-bottom: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-card-body h2 a:hover { color: var(--cta-deep); }
.asset-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.asset-card-description { color: var(--ink-2); font-size: 12.5px; line-height: 1.6; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.asset-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; }
.text-link { color: var(--cta-deep); font-size: 13px; font-weight: 650; }
.text-link:hover { color: var(--ink); }
.type-badge { display: grid; place-items: center; width: 100%; height: 100%; color: #6b5b47; font-size: 14px; font-weight: 700; background: linear-gradient(135deg, #f2e8db, #d9ccb9); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 30px 0 10px; }
.pagination .btn { min-width: 96px; padding: 8px 12px; }

/* Asset detail */
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; margin: 25px 0 8px; }
.breadcrumb a:hover { color: var(--ink); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 390px); gap: 28px; align-items: start; margin-top: 16px; }
.detail-media { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.detail-media > img, .detail-media > video { width: 100%; max-height: 680px; object-fit: contain; background: #f3ede4; }
.detail-file { min-height: 380px; display: grid; place-items: center; background: #f3ede4; color: var(--ink-2); }
.detail-file strong { display: block; font-size: 44px; color: var(--bean); text-align: center; }
.detail-side { padding: 24px; position: sticky; top: 84px; }
.detail-side h1 { font-size: 24px; line-height: 1.35; margin: 8px 0 12px; }
.detail-description { color: var(--ink-2); font-size: 14px; white-space: pre-line; }
.detail-actions { display: grid; gap: 10px; margin: 20px 0; }
.detail-facts { display: grid; gap: 9px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-fact { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; }
.detail-fact dt { color: var(--ink-3); }
.detail-fact dd { color: var(--ink-2); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.license-note { margin-top: 16px; padding: 12px 14px; background: var(--success-soft); color: var(--success); border-radius: 10px; font-size: 12px; line-height: 1.65; }

/* Auth / account */
.auth-page { max-width: 560px; margin: 62px auto 0; }
.auth-card { padding: 30px; }
.auth-card h1 { font-size: 26px; margin-bottom: 8px; }
.auth-card > p { color: var(--ink-2); font-size: 13.5px; margin-bottom: 22px; }
.form-stack { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 650; }
.field small { color: var(--ink-3); font-size: 11.5px; }
.field textarea { min-height: 120px; resize: vertical; }
.field-error { color: var(--danger); font-size: 12px; }
.form-help { font-size: 12px; color: var(--ink-3); margin-top: 12px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 18px; font-size: 13px; }
.account-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 42px 0 22px; }
.account-head h1 { font-size: 28px; }
.account-head p { color: var(--ink-2); font-size: 13px; margin-top: 6px; }
.account-layout { display: grid; grid-template-columns: 225px minmax(0, 1fr); gap: 28px; align-items: start; }
.account-nav { padding: 12px; position: sticky; top: 84px; }
.account-nav a { display: block; padding: 10px 12px; border-radius: 9px; color: var(--ink-2); font-size: 13.5px; }
.account-nav a:hover, .account-nav a.active { background: var(--ink); color: #fff; }
.account-content { min-width: 0; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.account-card { padding: 22px; margin-bottom: 18px; }
.account-card h2 { font-size: 16px; margin-bottom: 14px; }
.account-card h2 small { font-size: 11px; color: var(--ink-3); font-weight: 500; margin-left: 7px; }
.balance-card { color: #fff; border: 0; }
.balance-card.points { background: linear-gradient(120deg, #b05a38, #d98b5c); }
.balance-card.member { background: linear-gradient(120deg, #2f5b45, #4a8c69); }
.balance-label { font-size: 13px; opacity: .82; }
.balance-value { font-size: 35px; font-weight: 800; line-height: 1.2; margin: 10px 0 5px; }
.balance-sub { font-size: 12.5px; opacity: .84; min-height: 22px; }
.account-table-wrap { overflow-x: auto; }
.account-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 530px; }
.account-table th, .account-table td { padding: 11px 9px; text-align: left; border-bottom: 1px solid var(--line); }
.account-table th { color: var(--ink-3); font-weight: 600; font-size: 12px; }
.account-table td { color: var(--ink-2); }
.account-table tr:last-child td { border-bottom: 0; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card { display: flex; flex-direction: column; padding: 19px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.plan-card h3 { font-size: 15px; }
.plan-price { font-size: 26px; font-weight: 800; margin: 8px 0 3px; color: var(--bean); }
.plan-price small { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.plan-detail { font-size: 12px; color: var(--ink-2); min-height: 37px; }
.plan-card .btn { margin-top: 15px; width: 100%; }
.orders-empty { color: var(--ink-3); font-size: 13px; }

/* Upload */
.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.upload-card { padding: 24px; }
.drop-zone { display: grid; place-items: center; gap: 8px; min-height: 190px; padding: 28px; border: 2px dashed var(--line-2); border-radius: var(--radius); background: #fff; text-align: center; cursor: pointer; transition: .15s; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--cta-deep); background: #fffdf9; }
.drop-zone .drop-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; background: var(--bean-soft); color: var(--bean); font-size: 24px; }
.drop-zone strong { font-size: 15px; }
.drop-zone span { font-size: 12.5px; color: var(--ink-3); }
.file-selected { width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fffaf3; color: var(--ink-2); font-size: 13px; text-align: left; overflow-wrap: anywhere; }
.upload-form { display: grid; gap: 17px; margin-top: 22px; }
.upload-side .account-card { margin-bottom: 16px; }
.rules { list-style: none; display: grid; gap: 9px; color: var(--ink-2); font-size: 12.5px; }
.rules li { display: flex; gap: 8px; line-height: 1.6; }
.rules li::before { content: "·"; color: var(--cta-deep); font-weight: 900; }
.upload-progress { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.upload-progress > i { display: block; width: 0; height: 100%; background: var(--cta-deep); transition: width .2s; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; max-width: min(380px, calc(100vw - 40px)); padding: 12px 15px; border-radius: 10px; box-shadow: 0 16px 30px rgba(42,31,20,.14); background: var(--ink); color: #fff; font-size: 13px; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

@media (max-width: 960px) {
  .home-hero { padding-top: 35px; }
  .feature-grid { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout, .upload-layout, .account-layout { grid-template-columns: minmax(0, 1fr); }
  .detail-side, .account-nav { position: static; }
  .account-nav { display: flex; gap: 4px; overflow-x: auto; padding: 9px; }
  .account-nav a { white-space: nowrap; flex: 0 0 auto; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-toggle { display: block; margin-left: auto; }
  .hd-in { gap: 12px; }
  .hd .nav { display: none; position: absolute; left: 16px; right: 16px; top: 60px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.98); box-shadow: 0 16px 30px rgba(42,31,20,.1); }
  .hd .nav.open { display: grid; }
  .hd .nav a { padding: 10px 12px; }
}
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .hd-in { height: 58px; }
  .logo { font-size: 17px; }
  .hd-right { gap: 7px; }
  .auth-link { font-size: 12px; }
  .auth-register { display: none; }
  .bean-pill { padding: 5px 9px; font-size: 12px; }
  .avatar { width: 31px; height: 31px; }
  .page-head, .account-head { display: block; margin-top: 30px; }
  .page-head-actions { margin-top: 14px; }
  .hero { gap: 25px; }
  .hero-btns { flex-wrap: wrap; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 16px 14px; }
  .stat b { font-size: 20px; }
  .search-form { min-width: 100%; }
  .library-toolbar { align-items: stretch; }
  .asset-grid { grid-template-columns: 1fr; }
  .detail-side, .upload-card, .auth-card, .account-card { padding: 19px; }
  .detail-side h1 { font-size: 22px; }
  .plan-grid, .account-grid { grid-template-columns: 1fr; }
  .ft { margin-top: 52px; }
}
