/**
 * 全局公共CSS（合并版）
 * 文件位置：/www/wwwroot/3.zf1.top/common/common.css
 * 功能：整合所有页面通用样式 + 专用样式，无重复、无冲突
 */

/* ========== 全局样式重置 | 所有页面通用 ========== */
* { 
    margin: 0; padding: 0; box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif; 
}
body { 
    background: #f5f5f5; 
    font-size: 14px; 
    color: #333; 
    padding: 48px 0 60px; 
    min-height: 100vh;
    width: 100%;
    margin: 0;
    display: block; /* 关键：必须生效 */
}

/* ========== 新增：顶部导航样式 | 所有页面通用 ========== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: #2196F3;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 999;
}
.back-btn-container {
    width: 32px;
    height: 32px;
}
.back-home-btn {
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.back-home-btn:hover {
    background: rgba(255,255,255,0.3);
}
.nav-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 auto;
    text-align: center;
    flex: 1;
}
/* 分页控件样式 */
.pagination {
    margin: 20px 0;
    text-align: center;
    font-size: 14px;
}
.pagination-btn {
    margin: 0 5px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
}
.pagination-btn.disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #eee;
}
.pagination-info {
    margin: 0 10px;
    color: #666;
}
/* ========== 新增：内容容器样式 | 所有页面通用 ========== */
.content {
    padding: 60px 15px 15px;
    max-width: 500px;
    margin: 0 auto;
}

/* ========== 页面布局 | 仅fee_type.php使用 ========== */
.page-container {
    width: 100%; max-width: 500px; margin: 0 auto; padding: 0;
}
.btn-group { 
    display: flex; gap: 10px; margin: 15px 15px; max-width: 500px;
}
.add-category-btn, .add-name-btn { 
    flex: 1; height: 48px; line-height: 48px; text-align: center; 
    border-radius: 8px; color: #fff; font-size: 16px; text-decoration: none;
    transition: opacity 0.2s;
}
.add-category-btn { background: #FF9800; }
.add-name-btn { background: #4CAF50; }
.add-category-btn:active, .add-name-btn:active { opacity: 0.8; }
.type-container { 
    background: #fff; border-radius: 8px; padding: 15px; 
    margin: 0 15px 15px; max-width: 500px;
}
.category-item { padding: 12px 0; border-bottom: 1px solid #eee; }
.category-item:last-child { border-bottom: none; }
.category-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.category-name { font-size: 16px; font-weight: 600; color: #333; }

/* ========== 通用状态样式 | 所有页面可复用 ========== */
.disabled-item .category-name, 
.disabled-item .name-text { 
    color: #999 !important; 
    text-decoration: line-through; 
}
.disabled-tag { 
    font-size: 11px; color: #ff8f00; background: #fff8e1; 
    padding: 2px 6px; border-radius: 3px; margin-left: 8px;
    display: inline-block;
}
.disabled-item .disabled-tag {
    background: #999;
    color: #fff;
}

/* ========== 通用按钮样式 | 所有页面可复用 ========== */
.more-wrap { text-align: center; }
.more-btn { 
    padding: 6px 12px; border: 1px solid #2196F3; border-radius: 4px; 
    font-size: 13px; cursor: pointer; background: #fff; color: #2196F3;
    transition: all 0.2s ease;
}
.more-btn:hover { background: #f0f7ff; }
.more-btn:active { opacity: 0.8; }
.more-btn.category { font-weight: 500; }
.more-btn.name { font-weight: normal; }

/* ========== 列表样式 | 仅fee_type.php使用 ========== */
.name-list { margin-left: 15px; }
.name-item { 
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid #eee; width: 100%;
}
.name-item:last-child { border-bottom: none; }
.name-text { 
    font-size: 15px; color: #666; padding: 0 8px; 
}
.empty { text-align: center; padding: 20px 0; color: #999; font-size: 14px; }

/* ========== 弹窗基础样式 | 所有页面通用 ========== */
.detail-modal, .modal { 
    display: none; position: fixed; top: 0; left: 0; 
    width: 100vw; height: 100vh; background: rgba(0,0,0,0.5); 
    z-index: 1000; align-items: center; justify-content: center;
    padding: 20px;
}
.confirm-modal {
    display: none; position: fixed; top: 0; left: 0; 
    width: 100vw; height: 100vh; background: rgba(0,0,0,0.5); 
    z-index: 1000; align-items: center; justify-content: center;
    padding: 0;
}

/* ========== 详情弹窗 | 仅fee_type.php使用 ========== */
.detail-content { 
    background: #fff; border-radius: 12px; padding: 25px; 
    width: 100%; max-width: 380px;
}
.detail-title { 
    font-size: 18px; font-weight: 600; text-align: center; 
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee;
    color: #333;
}
.detail-info { 
    margin-bottom: 25px; display: flex; flex-direction: column; gap: 12px; 
    background: #f5f5f5; padding: 15px; border-radius: 8px;
}
.info-row { display: flex; justify-content: space-between; padding: 0 5px; font-size: 15px; }
.info-label { color: #666; }
.info-value { color: #333; font-weight: 500; }

/* ========== 操作按钮 | 所有页面可复用 ========== */
.detail-opt { 
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; 
}
.opt-btn { 
    padding: 10px 0; border: none; border-radius: 4px; font-size: 14px; cursor: pointer;
    transition: background-color 0.2s ease;
}
.opt-btn.normal { background: #2196F3; color: #fff; }
.opt-btn.normal.edit { background: #4CAF50; color: #fff; }
.opt-btn.normal.delete { background: #f44336; color: #fff; }
.opt-btn.normal.disable { background: #FF9800; color: #fff; }
.opt-btn.normal.enable { background: #8BC34A; color: #fff; }
.opt-btn.disabled { 
    background: #eee; color: #999; cursor: not-allowed; 
    opacity: 0.6;
}
.close-btn { 
    width: 100%; padding: 10px 0; border: 1px solid #ddd; 
    border-radius: 4px; font-size: 14px; cursor: pointer; 
    background: #fff; color: #666;
    transition: background 0.2s;
}
.close-btn:hover { background: #f5f5f5; }

/* ========== 新增/编辑弹窗 | 仅fee_type.php使用 ========== */
.modal-content { 
    background: #fff; border-radius: 12px; padding: 25px; 
    width: 100%; max-width: 400px;
}
.modal-title { 
    font-size: 18px; font-weight: 600; margin-bottom: 20px; 
    color: #333; text-align: center;
}
.modal-input { 
    width: 100%; padding: 12px 15px; border: 1px solid #e5e5e5; 
    border-radius: 8px; margin-bottom: 20px; font-size: 15px;
}
.modal-input:focus { border-color: #2196F3; outline: none; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.modal-btn { 
    padding: 10px 20px; border: none; border-radius: 6px; 
    font-size: 15px; cursor: pointer;
}
.modal-btn-confirm { background: #2196F3; color: #fff; }
.modal-btn-cancel { background: #f5f5f5; color: #666; }
.modal-btn:active { opacity: 0.8; }

/* ========== 统一确认弹窗 | 所有页面可复用 ========== */
.confirm-content { 
    background: #fff; border-radius: 12px; 
    padding: 25px 20px; width: 85%; max-width: 320px; text-align: center;
}
.confirm-text { 
    font-size: 16px; color: #333; line-height: 1.4; 
    margin-bottom: 22px; font-weight: 400;
}
.confirm-btns { 
    display: flex; gap: 10px; padding: 0 5px; justify-content: center;
}
.confirm-btns button { 
    flex: 1; padding: 10px 0; border-radius: 6px; font-size: 15px;
    cursor: pointer; border: none; height: 42px; line-height: 1;
}
.confirm-yes { background: #2196F3; color: #fff; font-weight: 400; }
.confirm-no { background: #f5f5f5; color: #333; font-weight: 400; }
.confirm-btns.single-btn { gap: 0; }
.confirm-btns.single-btn button { min-width: 120px; }


/* ========== 辅助样式 | 仅fee_type.php使用 ========== */
.type-data { display: none; }
button:active { opacity: 0.8; }

/* ========== 新增：退出提示框样式 | 所有页面通用 ========== */
.exit-toast {
    position: fixed;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    display: none;
    z-index: 99999;
    min-width: 180px;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* ========== 新增：通用表单样式 | 所有页面通用 ========== */
.form-group { 
    margin-bottom: 15px; 
    display: flex;
    align-items: center;
    gap: 10px; 
}
.form-label { 
    display: inline-block; 
    width: 80px; 
    flex-shrink: 0; 
    color: #333; 
    font-weight: 500; 
    font-size: 14px; 
}
.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}
.form-input {
    flex: 1; 
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    -webkit-appearance: none;
    background: #fff;
    min-width: 0; 
}
.form-input::placeholder {
    color: #999;
    font-weight: 400;
    font-size: 14px;
}
.form-input:focus { 
    border-color: #2196F3; 
    box-shadow: 0 0 0 2px rgba(33,150,243,0.1);
}
.form-input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* ========== 新增：时间选择框样式 | 所有页面通用 ========== */
.time-select-wrapper {
    flex: 1;
}
.time-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    -webkit-appearance: none;
    background: #fff;
}
.time-input:focus {
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33,150,243,0.1);
}
/* ========== 登录/注册页通用样式 | 所有登录类页面复用 ========== */
/* 登录/注册容器（复用type-container基础样式，仅微调） */
.login-container, .register-container {
    max-width: 420px;
    width: 100%;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px #eee;
    box-sizing: border-box;
}

/* 登录/注册标题（复用已有颜色/字体规则） */
.login-title {
    text-align: center;
    color: #2196F3;
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 500;
}

.login-subtitle {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
}

/* 登录/注册表单组（复用form-group，调整间距） */
.login-form-group {
    margin-bottom: 20px;
}

.login-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

/* 登录输入框（复用modal-input样式，保证和其他页面输入框一致） */
.login-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-color: #2196F3;
    outline: none;
}

/* 错误提示（复用已有错误颜色体系） */
.login-error {
    color: #f44336;
    text-align: center;
    margin: 10px 0;
    font-size: 14px;
    padding: 8px;
    background: #ffebee;
    border-radius: 4px;
}

/* 登录按钮（复用opt-btn.normal样式，仅调整尺寸） */
.login-btn {
    width: 100%;
    padding: 12px;
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #1976D2;
}

/* 登录链接（复用已有链接颜色规则） */
.login-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.login-link a {
    color: #2196F3;
    text-decoration: none;
}

.login-link a:hover {
    text-decoration: underline;
}

/* 密码提示（复用辅助文字样式） */
.password-hint {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 移动端适配（统一适配规则） */
@media (max-width: 480px) {
    .login-container, .register-container {
        padding: 20px 15px;
    }
    
    /* 修复移动端顶部导航下的内容间距 */
    .login-page-content {
        padding: 70px 15px 15px !important;
    }
}