/* ================= ==========================================
   ZeroPass Mini · Modern Design
   ========================================================== */

:root {
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --primary: #4f46e5;
    --primary-bg: #e0e7ff;
    --header-h: 56px;

    --border: #e2e8f0;
    --border-focus: #818cf8;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
}

/* 基础重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding-bottom: 85px;
}

.app-wrapper {
    width: 100%;
    max-width: 480px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 导航头 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-h);
    padding: 0 4px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}
.brand-text { display: flex; align-items: center; gap: 6px; }
.brand-text .title { font-weight: 800; font-size: 19px; letter-spacing: -0.5px; }
.brand-text .badge {
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.icon-btn {
    background: var(--card); border: 1px solid var(--border);
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--text-secondary); cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.icon-btn:active { transform: scale(0.92); }

/* 卡片容器 */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.card-header { margin-bottom: 12px; }
.card-title { font-size: 13px; font-weight: 700; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* 表单样式 */
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 14px; color: var(--text-muted); font-size: 16px; pointer-events: none; }
.input-wrapper input {
    width: 100%; padding: 12px 14px 12px 38px;
    background: #f8fafc; border: 1px solid var(--border);
    border-radius: var(--radius-md); font-size: 15px; color: var(--text); outline: none;
    transition: all 0.2s;
}
.input-wrapper input:focus { background: #fff; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }

/* 占位与结果区域 */
.placeholder-box { text-align: center; padding: 24px 10px; color: var(--text-muted); }
.placeholder-icon-wrap {
    width: 48px; height: 48px; background: #f1f5f9; color: var(--text-secondary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin: 0 auto 10px auto;
}
.placeholder-text { font-size: 13px; }

/* main.js 渲染出的结果区域 */
.result-view {
    background: #f8fafc;
    border: 1px dashed var(--border-focus);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}
.result-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.result-row .label { color: var(--text-secondary); }
.result-row .value { font-weight: 600; font-family: ui-monospace, SFMono-Regular, monospace; }
.result-row .value.password { font-size: 16px; color: var(--primary); letter-spacing: 1px; }
.result-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }

/* 最近历史记录列表 */
.text-btn { background: none; border: none; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 12px 0; }

.history-item {
    background: #f8fafc; border: 1px solid var(--border); padding: 10px 12px;
    border-radius: var(--radius-sm); display: flex; justify-content: space-between; align-items: center; cursor: pointer;
    transition: all 0.15s;
}
.history-item:hover { background: #fff; border-color: var(--border-focus); }
.h-left { display: flex; flex-direction: column; }
.h-domain { font-size: 13px; font-weight: 700; color: var(--text); }
.h-identity { font-size: 11px; color: var(--text-muted); }
.h-actions { display: flex; align-items: center; gap: 8px; }
.h-pwd { font-family: monospace; font-size: 13px; color: var(--text-secondary); }
.h-copy-btn, .h-delete-btn { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 2px; }
.h-copy-btn:hover { color: var(--primary); }
.h-delete-btn:hover { color: #ef4444; }

/* Toast 提示 */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px);
    background: #0f172a; color: #fff; padding: 8px 18px; border-radius: 20px;
    font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 1000;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 底部 Taskbar 按钮组 */
.footer-navbar {
    position: fixed; bottom: 0; left: 0; right: 0; height: 68px;
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); display: flex; justify-content: space-around;
    align-items: center; max-width: 480px; margin: 0 auto; z-index: 90; padding: 0 12px;
}
.footer-action {
    background: #fff; border: 1px solid var(--border); padding: 8px 14px;
    border-radius: var(--radius-md); display: flex; align-items: center; gap: 6px;
    color: var(--text); cursor: pointer; font-size: 13px; font-weight: 600;
    box-shadow: var(--shadow-sm); transition: all 0.15s;
}
.footer-action i { font-size: 16px; color: var(--primary); }
.footer-action:active { transform: scale(0.95); }

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

/* Modal 遮罩全屏修复 */
.modal-backdrop {
    display: none;
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(4px);
    z-index: 9999 !important;
    align-items: center; justify-content: center;
    padding: 16px;
}

.modal-backdrop.active { display: flex !important; }

.modal-card {
    background: #fff; width: 100%; max-width: 440px; max-height: 85vh;
    border-radius: var(--radius-lg); padding: 20px;
    display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-header h3 { font-size: 15px; font-weight: 700; }
.close-icon { background: none; border: none; font-size: 22px; color: var(--text-muted); cursor: pointer; }

.modal-toolbar { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.sm-btn {
    padding: 5px 10px; font-size: 12px; font-weight: 600;
    border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
}
.btn-danger { color: #ef4444; border-color: #fca5a5; }
.btn-danger-ghost { color: #ef4444; background: #fef2f2; border: none; }

.modal-body { overflow-y: auto; flex: 1; }
.date-header { font-size: 12px; font-weight: 700; color: var(--text-muted); margin: 12px 0 6px 0; }
