*{box-sizing:border-box}
body{margin:0;font-family:Arial,"Microsoft YaHei",sans-serif;background:#e6e6e6;color:#222;font-size:14px}
a{text-decoration:none;color:#05c}
.topbar{height:32px;line-height:32px;background:#514b55;color:white;padding:0 10px;font-weight:bold}
.topbar a{color:white;margin-left:15px}
.layout{display:flex;min-height:calc(100vh - 32px)}
.sidebar{width:128px;background:#4d4c55;border-right:2px solid #333}
.sidebar a{display:block;padding:10px 8px;color:#ffff00;border-bottom:1px solid #666;font-weight:bold}
.sidebar a.active,.sidebar a:hover{background:#f00;color:#fff}
.main{flex:1;padding:16px;overflow:auto}
.red-guide{font-size:24px;color:#f00;line-height:1.5;margin:10px 0 15px 24px;letter-spacing:2px}
.panel{background:#eee;border:1px solid #888;margin-bottom:14px}
.panel-title{background:#bdbdbd;padding:9px;border-bottom:1px solid #888;font-weight:bold}
.row{padding:9px 10px;border-bottom:1px solid white}
.btn{display:inline-block;padding:5px 10px;border:1px solid #777;background:#fff;border-radius:3px;cursor:pointer;color:#111;margin:1px}
.btn.red{background:#d90000;color:#fff;border-color:#900}
.btn.blue{background:#236fd0;color:#fff;border-color:#174c8f}
.btn.green{background:#008b50;color:#fff;border-color:#005c35}
input,select,textarea{padding:6px;border:1px solid #888;background:white;border-radius:2px}
textarea{width:100%;min-height:90px}
table{width:100%;border-collapse:collapse;background:#f8f8f8}
th,td{border:1px solid #aaa;padding:8px;text-align:left}
th{background:#c8c8c8}
.type-table td{border:1px solid #999;padding:12px}
.type-group{width:190px;background:#f0f0dc;text-align:center;font-weight:bold}
.type-item{display:inline-block;margin:7px 12px 7px 0;padding:4px 6px;background:white;border:1px solid #ff5a2a;border-radius:5px}
.type-item .num{width:50px}
.ok{color:#008000;font-weight:bold}
.err{color:#d00000;font-weight:bold}
.small{color:#666;font-size:12px}
.login{width:370px;margin:110px auto;background:white;border:1px solid #999;border-radius:8px;padding:24px;box-shadow:0 3px 18px rgba(0,0,0,.16)}
.login h2{text-align:center;margin:0 0 20px}
.login input{width:100%;margin-bottom:12px}

/* v1064：后台菜单分组与色块选择 */
.sidebar-v1064{padding-bottom:20px;}
.admin-menu-group{padding:0 0 4px 0;}
.admin-menu-gap{margin-top:16px;padding-top:12px;border-top:2px solid rgba(255,255,255,.18);}
.admin-menu-title{padding:8px 8px 5px;color:#fff;background:#3f3e46;font-size:12px;font-weight:bold;letter-spacing:1px;}
.sidebar-v1064 a{border-bottom:1px solid #666;}
.color-picker-v1064{display:flex;flex-wrap:wrap;gap:8px;max-width:760px;}
.color-chip-v1064{min-width:70px;height:34px;border:1px solid #888;border-radius:6px;cursor:pointer;font-weight:bold;box-shadow:inset 0 1px 0 rgba(255,255,255,.45);}
.color-chip-v1064.active{outline:3px solid #caa84f;outline-offset:1px;}

/* v1065：精简参数/首页广告设置页，移除错误的大量色块行 */
.settings-section-v1065{background:#f8f8f8;border:1px solid #aaa;margin:0 0 14px 0;}
.settings-section-v1065-title{background:#d7c08a;color:#3a2a0a;font-weight:900;font-size:16px;padding:9px 12px;border-bottom:1px solid #aaa;}
.settings-section-v1065 table{margin:0;}
.settings-section-v1065 th{width:220px;}
.settings-help-v1065{margin-top:5px;color:#666;font-size:12px;line-height:1.7;}


/* v1066 规则/充值客服图片上传移动到对应内容下面 */
.page-notice-upload-v1066{
    margin-top:10px;
    padding:10px 12px;
    border:1px dashed #b8a26d;
    background:#fff9e8;
    border-radius:6px;
}
.page-notice-upload-title{
    font-weight:700;
    margin-bottom:8px;
    color:#7a5100;
}
.settings-help-v1066{
    line-height:1.8;
    color:#666;
    font-size:13px;
}

/* v1067 参数/首页广告页面紧凑优化：外框小一点，输入框文字大一点 */
.main{padding:8px!important;}
h2{font-size:18px!important;line-height:1.2!important;margin:4px 0 8px!important;}
.ok,.err{margin:4px 0 8px!important;font-size:14px!important;}
.settings-section-v1065{margin:0 0 8px 0!important;border-color:#aaa!important;}
.settings-section-v1065-title{font-size:15px!important;line-height:1.2!important;padding:5px 8px!important;}
.settings-section-v1065 table{table-layout:fixed!important;margin:0!important;}
.settings-section-v1065 th{width:170px!important;font-size:13px!important;line-height:1.28!important;padding:5px 7px!important;vertical-align:middle!important;}
.settings-section-v1065 td{padding:5px 7px!important;vertical-align:middle!important;}
.settings-section-v1065 input[type="text"],
.settings-section-v1065 input[type="number"],
.settings-section-v1065 select,
.settings-section-v1065 textarea{
    font-size:18px!important;
    line-height:1.45!important;
    padding:7px 9px!important;
    border:1px solid #888!important;
    border-radius:3px!important;
}
.settings-section-v1065 input[type="text"],
.settings-section-v1065 input[type="number"]{
    height:36px!important;
    width:100%!important;
    max-width:620px!important;
}
.settings-section-v1065 textarea{
    width:100%;
    min-height:78px;
    height:88px;
    font-family:Consolas,"Microsoft YaHei",Arial,sans-serif!important;
}
.settings-section-v1065 textarea[name="rule_content"],
.settings-section-v1065 textarea[name="recharge_content"]{
    min-height:135px;
    height:150px;
    font-size:17px!important;
}
.settings-section-v1065 textarea[name="top_type_options"]{
    min-height:90px;
    height:100px;
}
.settings-help-v1066,.settings-help-v1065,.small{font-size:12px!important;line-height:1.45!important;margin-top:4px!important;}
.page-notice-upload-v1066{margin-top:6px!important;padding:6px 8px!important;border-radius:4px!important;}
.page-notice-upload-title{font-size:13px!important;margin-bottom:5px!important;}
.page-notice-upload-v1066 input[type="file"]{font-size:16px!important;padding:5px!important;background:#fff!important;}
form>p{margin:8px 0 0!important;}
form>p .btn.red{font-size:16px!important;padding:7px 18px!important;}
@media(max-width:900px){
  .settings-section-v1065 th{width:135px!important;font-size:12px!important;}
  .settings-section-v1065 input[type="text"],
  .settings-section-v1065 input[type="number"],
  .settings-section-v1065 select,
  .settings-section-v1065 textarea{font-size:16px!important;}
}

/* v1068 前台上方广告设置提示 */
.page-notice-upload-v1068{background:#fffdf2!important;border-color:#c9a95a!important;}
.settings-section-v1065 textarea[name="big_notice"]{min-height:105px;height:115px;font-size:17px!important;}

/* v1165：后台广告/公告/资料标题输入框支持手动放大缩小 */
textarea,
.settings-section-v1065 textarea,
textarea[name="big_notice"],
textarea[name="rule_content"],
textarea[name="recharge_content"],
textarea[name="home_ad_title_html"],
textarea[name="home_ad_domain_html"],
textarea[name="current_material_title"],
textarea[name="empty_material_ad_html"],
textarea[name="history_period_ad_html"]{
    resize: both !important;
    overflow: auto !important;
    max-width: none !important;
    min-width: 260px;
    min-height: 68px;
}

/* 广告框默认给大一点，右下角可拖动；拖大后可横向/纵向滚动 */
textarea[name="big_notice"]{
    height: 190px;
}
textarea[name="rule_content"],
textarea[name="recharge_content"]{
    height: 260px;
}
textarea[name="current_material_title"]{
    height: 125px;
}
textarea[name="empty_material_ad_html"]{
    height: 260px;
}
textarea[name="history_period_ad_html"]{
    height: 180px;
}
textarea[name="home_ad_title_html"],
textarea[name="home_ad_domain_html"]{
    height: 115px;
}

@media(max-width:900px){
    textarea,
    .settings-section-v1065 textarea,
    textarea[name="big_notice"],
    textarea[name="rule_content"],
    textarea[name="recharge_content"],
    textarea[name="home_ad_title_html"],
    textarea[name="home_ad_domain_html"],
    textarea[name="current_material_title"],
    textarea[name="empty_material_ad_html"],
    textarea[name="history_period_ad_html"]{
        min-width: 180px;
        width: 100%;
        resize: both !important;
    }
}


/* v1166：修复 v1165 固定高度导致拖动后回弹；textarea 允许浏览器写入内联宽高 */
textarea{
    resize: both !important;
    overflow: auto !important;
    max-width: none !important;
}
textarea.admin-resizable-v1166{
    resize: both !important;
    overflow: auto !important;
}
