/* ============================================================
   DM-Tech 官网 · 功能组件样式
   页面主体使用 Tailwind，此处仅承载登录 / 账户等交互组件
   ============================================================ */

:root {
    --apple-text: #1d1d1f;
    --apple-text-light: #86868b;
    --apple-blue: #0066cc;
    --apple-blue-hover: #0077ed;
    --apple-bg: #fbfbfd;
    --apple-border: rgba(0, 0, 0, 0.08);
    --apple-danger: #e0473e;
    --apple-success: #1ba672;
}

body {
    font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 表单内联提示 ---------- */
.inline-notice {
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 12px;
    margin-top: 12px;
    text-align: center;
    font-weight: 500;
    animation: noticeIn 0.25s ease;
}
.inline-notice--info    { background: rgba(0, 102, 204, 0.08);  color: var(--apple-blue); }
.inline-notice--success { background: rgba(27, 166, 114, 0.10); color: var(--apple-success); }
.inline-notice--warning { background: rgba(245, 158, 11, 0.12); color: #b7791f; }
.inline-notice--error   { background: rgba(224, 71, 62, 0.10);  color: var(--apple-danger); }
@keyframes noticeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- 全局 Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translate(-50%, 20px);
    background: rgba(29, 29, 31, 0.92);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 22px;
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 12000;
    max-width: 86vw;
    text-align: center;
    backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.toast--success { background: rgba(27, 166, 114, 0.95); }
.toast.toast--error   { background: rgba(224, 71, 62, 0.95); }
.toast.toast--warning { background: rgba(214, 132, 16, 0.95); }

/* ---------- 登录加载遮罩 ---------- */
.login-overlay {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 5;
}
.login-overlay.visible { opacity: 1; }
.login-overlay__spinner {
    width: 34px; height: 34px;
    border: 3px solid rgba(0, 102, 204, 0.15);
    border-top-color: var(--apple-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-overlay__check {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: var(--apple-success);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    animation: pop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.login-overlay__text { font-size: 14px; font-weight: 600; color: var(--apple-text); }

/* ---------- 用户下拉菜单 ---------- */
.um-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--apple-text);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}
.um-item i { font-size: 16px; color: var(--apple-text-light); }
.um-item:hover { background: rgba(0, 0, 0, 0.05); }
.um-item--danger { color: var(--apple-danger); }
.um-item--danger i { color: var(--apple-danger); }
.um-sep { height: 1px; background: var(--apple-border); margin: 4px 6px; }

/* ---------- 账户面板（抽屉） ---------- */
.account-panel {
    position: fixed;
    inset: 0;
    z-index: 11000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.account-panel.open { opacity: 1; pointer-events: auto; }
.account-panel__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(4px);
}
.account-panel__sheet {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 760px;
    background: #fff;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.account-panel.open .account-panel__sheet { transform: translateX(0); }
.account-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--apple-border);
}
.account-panel__head h3 { font-size: 18px; font-weight: 700; color: var(--apple-text); letter-spacing: -0.01em; }
.account-panel__close {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #f5f5f7;
    color: var(--apple-text-light);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease;
    border: none; cursor: pointer;
}
.account-panel__close:hover { background: #e8e8ed; color: var(--apple-text); }
.account-panel__body { flex: 1; display: flex; min-height: 0; }
.account-nav {
    width: 190px;
    flex-shrink: 0;
    border-right: 1px solid var(--apple-border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fbfbfd;
    overflow-y: auto;
}
.account-nav button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--apple-text);
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}
.account-nav button i { font-size: 17px; color: var(--apple-text-light); }
.account-nav button:hover { background: rgba(0, 0, 0, 0.05); }
.account-nav button.active { background: var(--apple-blue); color: #fff; }
.account-nav button.active i { color: #fff; }

.account-content { flex: 1; padding: 26px 28px; overflow-y: auto; min-width: 0; }
.account-content h2 { font-size: 20px; font-weight: 700; color: var(--apple-text); margin-bottom: 20px; letter-spacing: -0.01em; }
.account-empty { color: var(--apple-text-light); font-size: 14px; text-align: center; margin-top: 40px; }

/* 账户面板内的表单 */
.ac-form .ac-field { margin-bottom: 16px; }
.ac-form label { display: block; font-size: 13px; font-weight: 600; color: var(--apple-text); margin-bottom: 7px; }
.ac-input {
    width: 100%;
    background: #f5f5f7;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 13px 15px;
    font-size: 15px;
    color: var(--apple-text);
    transition: all 0.2s ease;
}
.ac-input:focus { background: #fff; border-color: var(--apple-blue); box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1); outline: none; }
.ac-btn {
    width: 100%;
    background: var(--apple-text);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 6px;
}
.ac-btn:hover { background: #000; }
.ac-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 账户面板内的表格 */
.ac-table-wrap { overflow-x: auto; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ac-table th, .ac-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--apple-border); }
.ac-table th { font-size: 12px; font-weight: 600; color: var(--apple-text-light); text-transform: uppercase; letter-spacing: 0.04em; }
.ac-table td { color: var(--apple-text); }
.ac-table .km { font-family: 'SF Mono', ui-monospace, monospace; font-size: 13px; }
.ac-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ac-badge--year { background: rgba(52, 152, 219, 0.12); color: #2980b9; }
.ac-badge--test { background: rgba(46, 204, 113, 0.12); color: #27ae60; }

.ac-empty-state { text-align: center; padding: 50px 20px; color: var(--apple-text-light); }
.ac-empty-state i { font-size: 46px; color: #d0d0d5; display: block; margin-bottom: 14px; }
.ac-empty-state p { font-size: 15px; }

/* 开通 / 续费 */
.ac-status-line {
    display: flex; align-items: center; gap: 8px;
    background: #f5f5f7; border-radius: 12px;
    padding: 12px 16px; margin-bottom: 18px;
    font-size: 14px; color: var(--apple-text-light);
}
.ac-expiry-card {
    background: #f5f5f7;
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 20px;
}
.ac-expiry-card p { font-size: 14px; color: var(--apple-text); margin: 6px 0; display: flex; align-items: center; gap: 8px; }
.ac-expiry-card i { color: var(--apple-blue); }

.ac-code-row { display: flex; gap: 10px; }
.ac-code-row .ac-input { flex: 1; }
.ac-code-btn {
    flex-shrink: 0;
    background: var(--apple-blue);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}
.ac-code-btn:hover { background: var(--apple-blue-hover); }
.ac-code-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 退出确认 */
.ac-logout-actions { display: flex; gap: 12px; margin-top: 24px; }
.ac-logout-actions button { flex: 1; border: none; border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 600; cursor: pointer; }
.ac-btn-confirm { background: var(--apple-danger); color: #fff; }
.ac-btn-cancel { background: #f5f5f7; color: var(--apple-text); }

/* ---------- 移动端适配 ---------- */
@media (max-width: 640px) {
    .account-panel__sheet { max-width: 100%; }
    .account-panel__body { flex-direction: column; }
    .account-nav {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--apple-border);
        overflow-x: auto;
        padding: 10px;
    }
    .account-nav button { white-space: nowrap; }
    .account-content { padding: 20px; }
    .toast { bottom: 24px; }
}
