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

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

    --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.08);
}

* {
    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: 75px;
}

.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);
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo-icon {
    width: 36px; height: 36px;
    background: var(--primary);
    color: #fff; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.brand-text { display: flex; align-items: center; gap: 6px; }
.brand-text .title { font-weight: 800; font-size: 18px; }
.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;
}

/* 卡片 */
.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: 14px; }
.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 { margin-bottom: 12px; }
.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: 12px; color: var(--text-muted); font-size: 16px; pointer-events: none; }
.input-wrapper input {
    width: 100%; padding: 10px 12px 10px 36px;
    background: #f8fafc; border: 1px solid var(--border);
    border-radius: var(--radius-md); font-size: 14px; color: var(--text); outline: none;
}
.input-wrapper input:focus { background: #fff; border-color: var(--border-focus); }

/* 下拉菜单 */
.combo-box { position: relative; }
.combo-toggle { position: absolute; right: 10px; background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.combo-menu {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
    max-height: 180px; overflow-y: auto; list-style: none; z-index: 50; box-shadow: var(--shadow-md); padding: 4px;
}
.combo-menu.open { display: block; }
.combo-menu li { padding: 8px 12px; font-size: 13px; border-radius: var(--radius-sm); cursor: pointer; }
.combo-menu li:hover { background: var(--primary-bg); color: var(--primary); }

/* 按钮 */
.action-row { display: flex; gap: 10px; margin-top: 16px; }
.btn {
    padding: 10px 16px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600;
    border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { flex: 1; background: var(--primary); color: #fff; }
.btn-ghost { background: var(--bg); border: 1px solid var(--border); color: var(--text-secondary); }

/* 占位图 & 动态结果 */
.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; }

.result-view { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: var(--radius-md); padding: 14px; }
.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.result-title { font-weight: 700; font-size: 13px; color: var(--primary); }
.result-actions { display: flex; gap: 6px; }
.action-btn { background: #fff; border: 1px solid var(--border); padding: 4px 8px; border-radius: 6px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }

.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: monospace; }
.result-row .value.password { font-size: 15px; color: var(--primary); letter-spacing: 1px; }

/* 强度条 */
.strength-wrapper { margin-top: 10px; }
.strength-bar-track { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.strength-bar-fill { height: 100%; background: #10b981; transition: width 0.3s; }
.strength-info { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* 历史列表 */
.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-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;
}
.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: 12px; 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; }

/* 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; opacity: 0; pointer-events: none; transition: all 0.2s ease; z-index: 1000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 底部 Taskbar 样式 */
.footer-navbar {
    position: fixed; bottom: 0; left: 0; right: 0; height: 60px;
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); display: flex; justify-content: space-around;
    align-items: center; max-width: 480px; margin: 0 auto; z-index: 90;
}
.footer-action {
    background: #fff; border: 1px solid var(--border); padding: 6px 12px;
    border-radius: 8px; display: flex; align-items: center; gap: 6px;
    color: var(--text); cursor: pointer; font-size: 12px; font-weight: 600;
}
.footer-action i { font-size: 16px; color: var(--primary); }

/* 核心修复：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.5) !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: 18px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.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: 20px; color: var(--text-muted); cursor: pointer; }

.modal-toolbar { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.sm-btn {
    padding: 5px 8px; 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: 10px 0 6px 0; }
