* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

.container {
    width: min(100% - 32px, 1440px);
    max-width: none;
    margin: 0 auto;
    padding: 24px 0;
}

header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #ff2442;
}

.subtitle {
    color: #999;
    font-size: 14px;
    margin-top: 8px;
}

.input-section {
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 24px;
}

.input-wrapper {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.input-wrapper textarea {
    flex: 1;
    min-height: 104px;
    max-height: 220px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s;
}

.input-wrapper textarea:focus {
    border-color: #ff2442;
}

.input-wrapper button {
    width: 104px;
    padding: 12px 20px;
    background: #ff2442;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.input-wrapper button:hover {
    background: #e0203a;
}

.input-wrapper button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.hint {
    font-size: 12px;
    color: #bbb;
    margin-top: 8px;
}

.error {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    background: #fff0f0;
    color: #d32f2f;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.result {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.result-main {
    display: grid;
    grid-template-columns: minmax(420px, 0.95fr) minmax(460px, 1.05fr);
    align-items: start;
    gap: 0;
}

.note-panel {
    min-width: 0;
    border-right: 1px solid #f0f0f0;
}

.media-panel {
    min-width: 0;
    background: #fff;
}

.result-header {
    padding: 24px 24px 16px;
}

.result-header h2 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

.meta {
    margin-top: 8px;
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #999;
}

.stats {
    display: flex;
    padding: 0 24px 20px;
    gap: 12px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    flex: 1;
    padding: 10px 8px;
    background: #fafafa;
    border-radius: 8px;
}

.stat-num {
    font-size: 20px;
    font-weight: 700;
    color: #ff2442;
}

.stat-label {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.section {
    padding: 0 24px 20px;
}

.media-panel .section {
    padding-top: 24px;
}

.section h3 {
    font-size: 15px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.section-title-row h3 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.download-btn {
    flex: 0 0 auto;
    padding: 6px 12px;
    border: 1px solid #ff2442;
    border-radius: 8px;
    background: #fff;
    color: #ff2442;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.download-btn:hover {
    background: #ff2442;
    color: #fff;
}

.download-btn:disabled {
    border-color: #ddd;
    color: #aaa;
    background: #f8f8f8;
    cursor: not-allowed;
}

.content {
    font-size: 14px;
    line-height: 1.8;
    color: #444;
    white-space: pre-wrap;
    word-break: break-all;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #fff0f3;
    color: #ff2442;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
}

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

.images img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    background: #f3f3f3;
}

.images img:hover {
    transform: scale(1.02);
}

.video video {
    width: 100%;
    border-radius: 8px;
    max-height: 600px;
}

.video a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #ff2442;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
}

.video a:hover {
    background: #e0203a;
}

.lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    cursor: default;
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 72px;
    border: 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.16);
    color: #fff;
    font-size: 48px;
    line-height: 1;
    cursor: pointer;
    z-index: 1001;
    transition: background 0.2s;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.28);
}

.lightbox-prev {
    left: 28px;
}

.lightbox-next {
    right: 28px;
}

.lightbox-counter {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 13px;
    z-index: 1001;
}

@media (max-width: 900px) {
    .container {
        width: min(100% - 24px, 720px);
        padding: 20px 0;
    }

    .result-main {
        display: block;
    }

    .note-panel {
        border-right: none;
    }

    .media-panel {
        border-top: 1px solid #f0f0f0;
    }
}

@media (max-width: 480px) {
    .input-wrapper { flex-direction: column; }
    .input-wrapper button { width: 100%; }
    .stats { gap: 8px; }
    .stat-num { font-size: 18px; }
    .images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lightbox-nav {
        width: 40px;
        height: 56px;
        font-size: 38px;
    }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}
