/* ============================================================
   style.css —— 前台 + 后台统一样式
   主题：暗黑 #1a1a1a / 主色 #FFD700
   ============================================================ */

:root{
    --bg:          #1a1a1a;
    --card:        #242424;
    --card-2:      #2f2f2f;
    --line:        #333333;
    --line-2:      #3a3a3a;
    --yellow:      #FFD700;
    --yellow-soft: rgba(255, 215, 0, .08);
    --yellow-glow: rgba(255, 215, 0, .45);
    --white:       #ffffff;
    --text:        #e6e6e6;
    --muted:       #8f8f8f;
    --radius:      14px;
}

*{
    box-sizing: border-box;
}

html{
    -webkit-text-size-adjust: 100%;
}

body{
    margin: 0;
    padding: 28px 16px 44px;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img{
    display: block;
    max-width: 100%;
}

a{
    color: inherit;
}

/* ============================================================
   前台
   ============================================================ */

.wrap{
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* ---------- 顶部图片卡片 ---------- */

.top-card{
    width: 100%;
    max-width: 300px;
    margin: 0 auto 18px;
    padding: 8px;
    background: var(--card);
    border: 1px solid #2b2b2b;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .32);
    text-align: center;
}

/* 关键：不套 <a>、不禁用 touch-callout，手机长按才会弹「保存图片」 */
.top-card img{
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 160px;
    margin: 0 auto;
    border-radius: 8px;
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    user-select: auto;
}

/* 多图横滑 */

.top-slider{
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 8px;
}

.top-slider::-webkit-scrollbar{
    display: none;
}

.top-slide{
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
}

.top-dots{
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.top-dot{
    width: 6px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s ease, transform .15s ease;
}

.top-dot.is-active{
    background: var(--yellow);
    transform: scale(1.15);
}

.top-card-more{
    display: inline-block;
    margin-top: 8px;
    color: var(--yellow);
    font-size: 12px;
    letter-spacing: .5px;
    text-decoration: none;
}

.top-card-more:hover{
    text-decoration: underline;
}

/* 收起 / 展开 */

.top-card-toggle{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    margin-top: 8px;
    padding: 5px 0 0;
    background: none;
    border: 0;
    border-top: 1px dashed rgba(255, 255, 255, .08);
    color: var(--muted);
    font-family: inherit;
    font-size: 12px;
    line-height: 1.7;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.top-card-toggle:hover{
    color: var(--yellow);
}

/* 没有 JS 时按钮保持隐藏，不出现点了没反应的死按钮 */
.top-card-toggle[hidden]{
    display: none;
}

.tct-arrow{
    font-size: 10px;
    opacity: .85;
}

.top-card.is-collapsed{
    padding-bottom: 6px;
}

.top-card.is-collapsed .top-card-body{
    display: none;
}

.top-card.is-collapsed .top-card-toggle{
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* ---------- 头部 ---------- */

.site-header{
    text-align: center;
    margin: 8px 0 22px;
}

.site-title{
    margin: 0;
    color: var(--white);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 3px;
    line-height: 1.2;
}

.title-line{
    width: 56px;
    height: 4px;
    margin: 14px auto 0;
    background: var(--yellow);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--yellow-glow);
}

/* ---------- 提示栏 ---------- */

.notice{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--yellow-soft);
    border-left: 4px solid var(--yellow);
    border-radius: 8px;
    color: #f0d67a;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.notice-icon{
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: var(--yellow);
    color: #1a1a1a;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

/* ---------- 主按钮展示图 ---------- */

.hero-img{
    margin: 20px 0 0;
    background: #141414;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-img img{
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ---------- 主按钮 ---------- */

.btn-main{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
    padding: 17px 20px;
    background: var(--yellow);
    color: #1a1a1a;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    text-decoration: none;
    border-radius: 999px;
    box-shadow: 0 0 18px var(--yellow-glow), 0 0 40px rgba(255, 215, 0, .18);
    transition: transform .15s ease, box-shadow .15s ease;
}

.btn-main:hover{
    box-shadow: 0 0 24px var(--yellow-glow), 0 0 56px rgba(255, 215, 0, .22);
}

.btn-main:active{
    transform: scale(.98);
    box-shadow: 0 0 10px var(--yellow-glow);
}

/* ---------- 卡片 ---------- */

.card{
    margin-top: 18px;
    padding: 16px 16px 18px;
    background: var(--card);
    border: 1px solid #2b2b2b;
    border-radius: var(--radius);
}

.card-title{
    position: relative;
    margin: 0 0 10px;
    padding-left: 12px;
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
}

.card-title::before{
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 16px;
    margin-top: -8px;
    background: var(--yellow);
    border-radius: 2px;
}

.card-line{
    height: 1px;
    margin: 0 0 14px;
    background: linear-gradient(90deg,
        var(--yellow) 0%,
        rgba(255, 215, 0, .35) 35%,
        rgba(255, 215, 0, 0) 100%);
}

/* ---------- 卡片内按钮 ---------- */

.btn-sub{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 16px;
    background: var(--card-2);
    border: 1px solid var(--line-2);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    text-align: center;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}

.btn-sub + .btn-sub{
    margin-top: 10px;
}

.btn-sub:hover{
    background: #383838;
    border-color: var(--yellow);
}

.btn-sub:active{
    transform: scale(.99);
}

/* ---------- 页脚 ---------- */

.site-footer{
    margin-top: 26px;
    text-align: center;
    color: #5f5f5f;
    font-size: 12px;
    letter-spacing: 1px;
}

/* ============================================================
   后台
   ============================================================ */

.admin-body{
    padding-top: 22px;
}

.admin-wrap{
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

.admin-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.admin-title{
    margin: 0;
    color: var(--white);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

.admin-title span{
    color: var(--yellow);
    font-size: 14px;
    font-weight: 400;
}

.admin-actions{
    display: flex;
    gap: 14px;
}

.link-ghost{
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
}

.link-ghost:hover{
    color: var(--yellow);
}

/* ---------- 面板 ---------- */

.panel{
    margin-bottom: 16px;
    padding: 18px;
    background: var(--card);
    border: 1px solid #2b2b2b;
    border-radius: var(--radius);
}

.panel-title{
    position: relative;
    margin: 0 0 16px;
    padding-left: 12px;
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
}

.panel-title::before{
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 15px;
    margin-top: -7.5px;
    background: var(--yellow);
    border-radius: 2px;
}

.sub-title{
    margin: 20px 0 12px;
    padding-top: 16px;
    border-top: 1px dashed #333;
    color: var(--yellow);
    font-size: 14px;
    font-weight: 600;
}

/* ---------- 表单 ---------- */

.form-grid{
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.form-row{
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.form-row label{
    color: var(--muted);
    font-size: 13px;
}

.form-row input[type="text"],
.form-row input[type="url"],
.form-row input[type="password"],
.form-row input[type="file"],
.form-row textarea{
    width: 100%;
    padding: 11px 12px;
    background: #1c1c1c;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-row input:focus,
.form-row textarea:focus{
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, .12);
}

.form-row input[type="file"]{
    padding: 9px 12px;
    color: var(--muted);
}

.form-row input::placeholder{
    color: #5f5f5f;
}

.span-2{
    grid-column: 1 / -1;
}

/* ---------- 按钮 ---------- */

.btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 26px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-primary{
    background: var(--yellow);
    color: #1a1a1a;
    box-shadow: 0 0 16px var(--yellow-glow);
}

.btn-primary:hover{
    box-shadow: 0 0 24px var(--yellow-glow);
}

.btn-primary:active{
    transform: scale(.98);
}

.btn-ghost{
    background: var(--card-2);
    border-color: var(--line-2);
    color: var(--text);
}

.btn-ghost:hover{
    border-color: var(--yellow);
}

.btn-block{
    display: flex;
    width: 100%;
    margin-top: 16px;
    letter-spacing: 2px;
}

.form-actions{
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

/* ---------- 提示 / 状态 ---------- */

.alert{
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    word-break: break-word;
}

.alert-ok{
    background: rgba(76, 210, 132, .10);
    border-left: 4px solid #4cd284;
    color: #9be7b8;
}

.alert-err{
    background: rgba(255, 92, 92, .10);
    border-left: 4px solid #ff5c5c;
    color: #ffb3b3;
}

.alert-warn{
    background: rgba(255, 215, 0, .08);
    border-left: 4px solid var(--yellow);
    color: #f0d67a;
}

.hint{
    margin: 10px 0 0;
    color: #6b6b6b;
    font-size: 12px;
    line-height: 1.6;
}

.footer-hint{
    margin-top: 18px;
}

.hint code{
    padding: 1px 5px;
    background: #1c1c1c;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--yellow);
    font-size: 12px;
}

/* ---------- 图片预览 ---------- */

.thumb{
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: #1c1c1c;
    border: 1px solid var(--line-2);
    border-radius: 10px;
}

.thumb img{
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    background: #141414;
    border-radius: 8px;
}

/* 多图缩略图列表 */

.thumb-list{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.thumb-item{
    padding: 6px;
    background: #1c1c1c;
    border: 1px solid var(--line-2);
    border-radius: 10px;
}

.thumb-item img{
    width: 100%;
    height: 64px;
    object-fit: cover;
    background: #141414;
    border-radius: 6px;
}

.check-del{
    margin-top: 6px;
    font-size: 12px;
}

.check{
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ff9a9a;
    font-size: 13px;
    cursor: pointer;
}

.check input{
    width: 16px;
    height: 16px;
    accent-color: #ff5c5c;
}

/* ---------- 登录页 ---------- */

.login-box{
    width: 100%;
    max-width: 400px;
    margin: 10vh auto 0;
    padding: 26px 22px 22px;
    background: var(--card);
    border: 1px solid #2b2b2b;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}

.login-head{
    text-align: center;
    margin-bottom: 22px;
}

.login-title{
    color: var(--white);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 3px;
}

.login-box .alert{
    margin-bottom: 14px;
}

.login-box .hint{
    text-align: center;
}

/* ---------- 宽屏 ---------- */

@media (min-width: 640px){
    .form-grid{
        grid-template-columns: 1fr 1fr;
    }
}
