/* ============================================================
   AI短剧工坊 — 公共样式系统（清理版）
   仅保留：动画/表单/骨架屏/文字保护/模式选择等非组件工具
   组件标准定义在 components.css（消除与Tabler遗留的对抗）
   ============================================================ */

/* ─── 标题层级体系 ─── */
.h1 {
    font-size: 22px; font-weight: 700;
    line-height: 1.25; letter-spacing: -0.03em;
    color: rgba(255,255,255,0.87);
}
.h2 {
    font-size: 18px; font-weight: 600;
    line-height: 1.3; letter-spacing: -0.02em;
    color: rgba(255,255,255,0.87);
}
.h3 {
    font-size: 15px; font-weight: 600;
    line-height: 1.35; letter-spacing: -0.01em;
    color: rgba(255,255,255,0.87);
}
.h4 {
    font-size: 13px; font-weight: 600;
    line-height: 1.4;
    color: rgba(255,255,255,0.85);
}
.body-text {
    font-size: 14px; line-height: 1.6;
    color: rgba(255,255,255,0.7);
}
.body-small {
    font-size: 12px; line-height: 1.5;
    color: rgba(255,255,255,0.5);
}
.caption {
    font-size: 11px; line-height: 1.4;
    color: rgba(255,255,255,0.55);
}

/* ─── 滚动条 ─── */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }


/* ─── 通用动画 ─── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}
@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1.2); }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── 移动端导航 ─── */
@media (max-width: 768px) {
    .mobile-nav { display: flex !important; }
}
@media (min-width: 769px) {
    .mobile-nav { display: none !important; }
}

/* 移动端菜单下拉（汉堡菜单内容区） */
#mobile-menu {
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
}
#mobile-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}


/* ─── 拍摄法卡片（2x2 网格） ─── */
.mode-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mode-cell {
    flex: 1 1 calc(50% - 4px);
    min-width: 180px;
    height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 12px 16px;
    background: #1c1c20;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.mode-cell:hover {
    border-color: rgba(96, 165, 250, 0.5);
    background: #222228;
}
@media (max-width: 640px) {
    .mode-cell { flex: 1 1 100%; height: 84px; }
}


/* ─── 卡片入场动画 ─── */
.card-enter {
    animation: cardEnter 0.4s ease both;
}
.card-enter-delayed {
    animation: cardEnter 0.4s ease both;
    animation-delay: 0.1s;
}
.card-enter-delayed-2 {
    animation: cardEnter 0.4s ease both;
    animation-delay: 0.2s;
}
.card-enter-delayed-3 {
    animation: cardEnter 0.4s ease both;
    animation-delay: 0.3s;
}
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ─── 页面入场 ─── */
.page-enter {
    animation: fadeIn 0.3s ease;
}


/* ─── 按钮加载态 ─── */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 16px; height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}
@keyframes btnSpin {
    to { transform: rotate(360deg); }
}


/* ─── 骨架屏 ─── */
.skeleton-card { padding: 16px; margin-bottom: 12px; }
.skeleton-line {
    height: 12px; border-radius: 6px; margin-bottom: 10px;
    background: rgba(255,255,255,0.06);
}
.skeleton-shimmer {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 0%,
        rgba(255,255,255,0.10) 50%,
        rgba(255,255,255,0.04) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
}


/* ─── 浮动徽章（非标准 badge） ─── */
.badge-gray { background: rgba(255,255,255,0.08); color: #aaa; }
.badge-green { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-red { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-yellow { background: rgba(234,179,8,0.15); color: #facc15; }
.badge-blue { background: rgba(59,130,246,0.15); color: #60a5fa; }


/* ─── 加载点动画 ─── */
.loading-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #3b82f6; animation: dotPulse 1.2s ease infinite;
}
.loading-dot-2 { animation-delay: 0.2s; }
.loading-dot-3 { animation-delay: 0.4s; }


/* ─── 表单元素（select / input / textarea） ─── */
select {
    padding: 12px 16px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    background: #16161a !important;
    color: #fff !important;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all .2s;
    color-scheme: dark !important;
}
select:hover {
    border-color: rgba(255,255,255,0.15) !important;
}
select:focus {
    border-color: rgba(255,255,255,0.45) !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
select option, option { color: #333 !important; background: #fff !important; }
input, textarea {
    padding: 12px 16px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: #16161a; color: #fff;
    font-size: 14px; font-family: inherit; outline: none;
    transition: all .2s;
    color-scheme: dark;
}
input:hover, textarea:hover { border-color: rgba(255,255,255,0.15); }
input:focus, textarea:focus {
    border-color: rgba(255,255,255,0.45);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}


/* ─── 交互元素光标 ─── */
input, textarea, [contenteditable] { user-select: text !important; -webkit-user-select: text !important; }
button, a, select, [data-action], [onclick] { cursor: pointer !important; }


/* ─── 文字溢出保护 ─── */
.voice-card .truncate,
.voice-card h3,
.voice-card span,
.voice-card p {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}
#vp-cards .voice-card .truncate,
#vp-cards .voice-card h3,
#vp-cards .voice-card span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}


/* ─── 移动端通用 ─── */
@media (max-width: 640px) {
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
    td, th { padding: 8px 10px !important; font-size: 12px; }
}

/* ─── 按钮溢出保护 ─── */
button, .btn, [class*="btn-"] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
@media (max-width: 640px) {
    button, .btn, [class*="btn-"] {
        min-height: 44px;
    }
}
