* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #e5e7eb;
    color: #333;
    line-height: 1.6;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #14b8a6 100%);
    border-radius: 16px 16px 0 0;
    color: #fff;
    margin-bottom:0;
}

.badge {
    display: inline-block;
    background: rgba(255,255,255,0.2) !important;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.hero h1 {
    font-size: 1.75rem;
    margin: 1rem 0 0 0;
    line-height: 1.4;
}

/* Intro Section - 介紹區塊 */
.intro-section {
    background: #f3f4f6;
    border-radius:0 0 16px 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.intro-section > h2 {
    text-align: center;
    font-size: 0.85rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 1rem 0;
    font-weight: 500;
}

.platform-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.platform-icons span {
    background: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.info-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 1.25rem;
    border-radius: 10px;
}

.info-box h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #1f2937;
}

.info-box p {
    margin: 0;
    color: #4b5563;
    font-size: 0.95rem;
}

.info-box hr {
    border: 0;
    border-top: 1px solid #f3f4f6;
    margin: 0.75rem 0;
}

.info-box .solution {
    color: #0ea5e9;
    font-weight: 600;
    margin: 0;
    font-size: 0.95rem;
}

/* Features - 小圖示 */
.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0;
    margin-top: 16px;
}

@media (max-width: 600px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
}

.feature {
    background: #fff;
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.feature-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.feature-text {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

/* ============================================
   主要操作區 - 明顯區隔
   ============================================ */
.app-section {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 2px solid #0ea5e9;
    margin-bottom: 1.5rem;
}

.app-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0ea5e9;
    margin: 0 0 1rem 0;
}

/* Input Section */
.input-section {
    margin-bottom: 1.25rem;
}

.input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 1rem;
}

.textarea-wrapper {
    position: relative;
}

textarea {
    width: 100%;
    height: 140px;
    padding: 14px;
    padding-right: 50px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    font-size: 16px;
    resize: vertical;
    transition: all 0.2s;
    background: #fafafa;
}

textarea:focus {
    outline: none;
    border-color: #0ea5e9;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.btn-clear-input {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: #e5e7eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 32px;
    color: #6b7280;
    transition: all 0.2s;
}

.btn-clear-input:hover {
    background: #ef4444;
    color: #fff;
    transform: none;
    box-shadow: none;
}

/* Result Section */
.result-section > h2 {
    font-size: 0.95rem;
    color: #374151;
    margin: 0 0 0.75rem 0;
    font-weight: 600;
}

ul.result-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.result-list > li {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.type-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.type-url {
    background: #dbeafe;
    color: #1d4ed8;
}

.type-email {
    background: #dcfce7;
    color: #15803d;
}

.content {
    flex: 1;
    word-break: break-all;
    min-width: 180px;
    font-family: "SF Mono", Consolas, monospace;
    font-size: 13px;
    color: #1f2937;
}

.decoded {
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
    word-break: break-all;
}

.decoded::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 8px;
}

.actions {
    display: flex;
    gap: 6px;
}

button {
    padding: 7px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-copy {
    background: #0ea5e9;
    color: #fff;
}

.btn-open {
    background: #10b981;
    color: #fff;
}

.btn-delete {
    background: #ef4444;
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
}

.empty-msg {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.copied {
    background: #10b981 !important;
}

/* History Section */
.history-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-header h2 {
    font-size: 0.95rem;
    color: #374151;
    margin: 0;
    font-weight: 600;
}

.btn-clear-all {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    padding: 6px 12px;
}

.btn-clear-all:hover {
    background: #ef4444;
    color: #fff;
}

ul.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.history-list > li {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-item-content {
    flex: 1;
    font-family: "SF Mono", Consolas, monospace;
    font-size: 13px;
    word-break: break-all;
    color: #374151;
    cursor: pointer;
}

.history-item-content:hover {
    color: #0ea5e9;
}

.history-time {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
}

/* ============================================
   更多工具連結
   ============================================ */
.tools-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.more-tools-link {
    display: inline-block;
    padding: 10px 20px;
    background: #f3f4f6;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.more-tools-link:hover {
    background: #0ea5e9;
    color: #fff;
}

/* Footer */
footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
}

footer a {
    color: #0ea5e9;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}
