:root {
    --primary-red: #fe2c55;
    --sidebar-bg: #ffffff;
    --card-width: 450px;
    --card-height: 600px; 
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
    background-color: #f0f2f5;
    height: 100vh;
    display: flex;
}

.app-container {
    display: flex;
    width: 100%;
}

/* Sidebar */
.controls {
    width: 380px;
    background: var(--sidebar-bg);
    padding: 24px;
    overflow-y: auto;
    border-right: 1px solid #e5e5ea;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
}

.controls h1 { margin: 0; font-size: 20px; font-weight: 800; }
.controls p { margin: 2px 0 0; color: #8e8e93; font-size: 12px; }

.control-section { display: flex; flex-direction: column; gap: 8px; }
.control-section label { font-size: 12px; font-weight: 700; color: #48484a; display: flex; justify-content: space-between; }

/* 用户信息行 */
.input-row { display: flex; align-items: center; gap: 10px; }
.avatar-upload {
    width: 44px;
    height: 44px;
    background: #f2f2f7;
    border: 1px dashed #c7c7cc;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar-upload img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload span { font-size: 20px; color: #8e8e93; }

input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e5ea;
    border-radius: 10px;
    background: #f9f9fb;
    font-size: 13px;
}

.custom-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e5ea;
    border-radius: 10px;
    background: #f9f9fb;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

textarea {
    width: 100%;
    height: 150px; 
    padding: 12px;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    background: #f9f9fb;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
}

.color-presets-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 8px 0;
}
.color-presets {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    padding: 4px 8px;
}
.color-tile {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 0 0 1px #e5e5ea;
    flex-shrink: 0;
    transition: all 0.2s;
}
.color-tile.active { transform: scale(1.15); box-shadow: 0 0 0 2px var(--primary-red); }

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e5e5ea;
    border-radius: 5px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-red);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.primary-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

/* Layer 1: Phone Frame */
.preview-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    overflow: auto;
}

.phone-frame {
    width: 420px; 
    height: 728px; 
    background: #000000; /* 手机外框层显示黑色 */
    border: 2px solid #333;
    border-radius: 54px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    position: relative;
}

/* 模拟手机听筒或灵动岛效果 */
.phone-frame::before {
    content: '';
    position: absolute;
    top: 20px;
    width: 90px;
    height: 20px;
    background: #1a1a1a;
    border-radius: 10px;
    z-index: 10;
}

.phone-screen {
    width: 396px; /* 396:704 = 9:16 */
    height: 704px;
    background: #f2f2f2; /* 手机屏幕显示浅灰色 */
    border-radius: 42px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Layer 2: Export Image (Background) */
.export-container {
    transform: scale(0.8); /* 调整预览缩放比例以适应新高度 */
    transform-origin: center;
}

.card {
    width: var(--card-width);
    height: var(--card-height);
    background: #000;
    padding: 25px; 
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Layer 3: Inner Content Card */
.inner-content-card {
    width: 100%;
    height: 100%;
    background: #000000; /* 固定黑色 */
    border-radius: 32px; /* 大圆角 */
    padding: 15px 35px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 5px;
}

.avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #333;
    border: 1px solid rgba(255,255,255,0.2);
    background-size: cover;
    background-position: center;
}

.user-text .name { font-weight: 800; font-size: 16px; color: white; }

/* 统一 日期、时间、星期 属性 */
.date, .time-info div {
    font-size: 12px;
    color: rgba(255,255,255,0.5); /* 半透明效果 */
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: capitalize;
}

.date { margin-top: 4px; }

.content-container {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
    padding-top: 10px;
}

.content {
    width: 100%;
    line-height: 1.55;
    font-weight: 900;
    word-break: break-all;
    white-space: pre-wrap;
    letter-spacing: 0.5px;
    color: white;
}

.highlight {
    text-shadow: 0 0 15px currentColor;
}

.card-footer-v3 {
    margin-top: auto;
    display: flex;
    flex-direction: column;
}

.time-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}
