* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: #f8f8f8;
    color: #333;
    line-height: 1.5;
    padding: 12px;
    padding-top: 36px;
}

body.frontend-page {
    max-width: 480px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

#countdown-bar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 50;
    height: 36px;
    background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#countdown-bar .countdown-icon {
    margin-right: 6px;
    animation: pulse 1s infinite;
}

#countdown-bar.expired {
    background: linear-gradient(90deg, #9ca3af 0%, #6b7280 100%);
}

#countdown-bar .timer-text {
    background: rgba(255, 255, 255, 0.25);
    padding: 0 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    margin: 0 4px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.notify-bubble {
    position: fixed;
    bottom: 100px;
    right: 16px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 8px 12px;
    border-radius: 30px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 40;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 250, 0.1);
    max-width: 220px;
}

.notify-bubble.show {
    transform: translateX(0);
}

.notify-bubble .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    flex-shrink: 0;
}

.notify-bubble .user-name {
    color: #fbbf24;
    font-weight: bold;
}

.notify-bubble .action-text {
    opacity: 0.8;
}

.carousel-wrapper {
    max-width: 1000px;
    margin: 16px auto;
}

.carousel-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #000;
    width: 100%;
}

.carousel-slides {
    display: flex;
    transition: transform 0.4s ease;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    background: #f0f0f0;
    cursor: pointer;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 2;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

.carousel-dot.active {
    background: white;
    width: 20px;
    border-radius: 4px;
}

.step-container,
.pay-container {
    max-width: 1000px;
    margin: 16px auto;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    border-left: 5px solid #999999;
}

.pay-container:first-of-type,
.hero-card {
    margin-top: 0;
}

.step-container .step-title {
    font-size: 18px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-container .step-title span {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: #e54d42;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
}

.step-container .step-title h2 {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    line-height: 1.4;
}

.text-content {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #000000;
}

.button-container {
    text-align: center;
    margin: 10px 0;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1a6dcc;
    color: white;
    padding: 8px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 15px;
    margin: 0 auto;
    width: fit-content;
    border: none;
    cursor: pointer;
}

.comment-generator-box {
    background: #fafafa;
    border-radius: 10px;
    padding: 8px 12px;
    margin: 8px 0;
    border: 1px solid #eee;
}

.comment-display-area {
    background: #ffffff;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid #eaeaea;
}

.comment-text-full {
    font-size: 14px;
    line-height: 1.45;
    background: #f4f7fb;
    padding: 8px 12px;
    border-radius: 20px;
    word-break: break-word;
    white-space: normal;
    font-family: monospace;
    color: #000000;
}

.copy-comment-btn-wrapper {
    text-align: center;
    margin-top: 6px;
    margin-bottom: 2px;
}

.copy-comment-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 40px;
    font-size: 16px;
    cursor: pointer;
}

.copy-comment-btn.copied {
    background: #4caf50;
}

#keywordList {
    list-style: none;
    padding-left: 0;
    margin: 8px 0;
}

#keywordList li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9f9f9;
    margin-bottom: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #eee;
    flex-wrap: nowrap;
    gap: 12px;
    min-width: 0;
}

.keyword-bubble {
    background: #eef2f5;
    color: #000000;
    font-size: 18px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 40px;
    display: inline-block;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    flex: 0 0 auto;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.keyword-bubble:active {
    background: #d0d8e0;
    transform: scale(0.98);
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.square-double-btn {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    border: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    line-height: 1.3;
    text-align: center;
    font-size: 18px;
    gap: 1px;
    background: #2196F3;
    color: white;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

.square-double-btn:active {
    transform: scale(0.92);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.square-double-btn .btn-icon {
    font-size: 22px;
    line-height: 1;
}

.square-double-btn .btn-label {
    font-size: 14px;
    letter-spacing: 0.5px;
}

.article-footer {
    max-width: 1000px;
    margin: 16px auto 0 auto;
    padding-top: 12px;
    text-align: center;
    color: #000000;
    font-size: 12px;
    border-top: 1px solid #eee;
}

.step-img-visible {
    display: block;
    margin-top: 12px;
}

.copy-toast {
    position: fixed;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 14px 30px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 500;
    z-index: 1000;
    pointer-events: none;
    animation: fadeOut 1s ease forwards;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translateX(-50%) scale(0.95); }
    20% { opacity: 1; transform: translateX(-50%) scale(1); }
    80% { opacity: 1; transform: translateX(-50%) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.95); visibility: hidden; }
}

.pay-large-text {
    font-size: 18px;
    line-height: 1.6;
}

.hero-text {
    text-align: center;
}

.hero-title {
    font-size: 28px;
    color: #FFD700;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}

.hero-title-second {
    margin-top: 6px;
}

.red-small-bold {
    color: #e54d42;
    font-weight: bold;
    font-size: 18px;
    margin-top: 6px;
    display: block;
}

.hint-red {
    color: #e53e3e;
    font-weight: 600;
    font-size: 18px;
    text-align: center;
    margin: 12px 0 8px 0;
}

.image-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.image-preview-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.block-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: 12px;
}

.block-card {
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    border: 1px solid #e8e8e8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.block-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.submit-page {
    padding-top: 12px;
}

.submit-card {
    max-width: 640px;
    margin-top: 24px;
}

.submit-hint {
    text-align: center;
    margin-bottom: 16px;
}

.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    margin-bottom: 16px;
}

.upload-area.dragover {
    border-color: #2196F3;
    background: #f0f8ff;
}

.upload-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.upload-note {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

.preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}

.preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.preview-item button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.submit-upload-btn {
    min-width: 180px;
}

.submit-success {
    text-align: center;
    padding: 24px 0 8px;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.back-link {
    display: inline-block;
    margin-top: 16px;
    color: #2196F3;
    text-decoration: none;
}

.admin-body {
    padding: 16px;
    padding-top: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-header h1 {
    font-size: 24px;
}

.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: #2196F3;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}

.admin-btn.secondary {
    background: #64748b;
}

.admin-btn.danger {
    background: #ef4444;
}

.admin-btn.success {
    background: #22c55e;
}

.admin-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.admin-card h2 {
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #334155;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="color"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group textarea.tall {
    min-height: 160px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row input {
    width: auto;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.radio-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.radio-row input {
    width: auto;
    margin: 0;
}

.form-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.5;
}

.admin-save-bar {
    position: sticky;
    bottom: 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 8px;
}

.admin-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.admin-alert.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.admin-alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.stat-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
}

.stat-box .label {
    font-size: 12px;
    color: #64748b;
}

.stat-box .today {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.stat-box .total {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    border: 1px solid #e2e8f0;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    background: #f8fafc;
}

.thumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.thumb-list img,
.carousel-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.carousel-manage {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.carousel-item {
    width: 140px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.carousel-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}

.carousel-item .item-actions {
    padding: 8px;
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.login-card {
    max-width: 420px;
    margin: 80px auto;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 20px;
}

@media (max-width: 640px) {
    .step-container, .pay-container {
        padding: 10px 14px;
        margin: 12px auto;
    }

    .step-container .step-title h2 { font-size: 16px; }

    .step-container .step-title span {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    body { padding: 8px; padding-top: 36px; }

    .hero-title { font-size: 24px; }
    .red-small-bold { font-size: 16px; }

    .copy-toast {
        font-size: 16px;
        padding: 12px 24px;
        white-space: normal;
        max-width: 90%;
    }

    .hint-red {
        font-size: 16px;
        margin: 10px 0 6px 0;
    }

    .square-double-btn {
        width: 64px;
        height: 64px;
        font-size: 15px;
        border-radius: 14px;
    }

    .square-double-btn .btn-icon { font-size: 18px; }
    .square-double-btn .btn-label { font-size: 12px; }
    .action-buttons { gap: 6px; }
    .keyword-bubble { font-size: 16px; padding: 6px 16px; }

    .carousel-btn { width: 30px; height: 30px; font-size: 16px; }
    .carousel-dot { width: 6px; height: 6px; }
    .carousel-dot.active { width: 16px; }
}
